Skip to content

Instantly share code, notes, and snippets.

View SamedBll's full-sized avatar

Samed SamedBll

  • Türkiye
View GitHub Profile
public class formis : ContentPage
{
public formis()
{
Content = new Label
{
Text = "Selam, Xamarin.Forms!",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
@SamedBll
SamedBll / Span-1
Created July 12, 2017 18:54
Add Span Objects-1
FormattedString formattedString = new FormattedString();
formattedString.Spans.Add(new Span
{
Text = "Ben ve "
});
formattedString.Spans.Add(new Span
{
Text = "Xamarin",
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
FontAttributes = FontAttributes.Bold
Content = new Label
{
FormattedText = new FormattedString
{
Spans =
{
new Span
{
Text = "Ben ve "
},
@SamedBll
SamedBll / namedSize.cs
Last active July 12, 2017 18:59
GetNamedSize (Constructor method)
public NamedFontSizes()
{
FormattedString formattedString = new FormattedString();
NamedSize[] namedSizes =
{
NamedSize.Default, NamedSize.Micro, NamedSize.Small,
NamedSize.Medium, NamedSize.Large
};
foreach (NamedSize namedSize in namedSizes)
{
@SamedBll
SamedBll / RenkDongusu.cs
Created July 18, 2017 15:14
Chapter - 16
class RenkDongusu : ContentPage
{
public RenkDongusu()
{
var colors = new[]
{
new { value = Color.White, name = "White" },
new { value = Color.Silver, name = "Silver" },
new { value = Color.Gray, name = "Gray" },
new { value = Color.Black, name = "Black" },
public class ReflectedRenkler : ContentPage
{
public ReflectedRenkler()
{
StackLayout stackLayout = new StackLayout();
// Döngü sayesinde renk yapısı alanları.
foreach (FieldInfo info in typeof(Color).GetRuntimeFields())
{
// Eski (yani hatalı yazıldı) renkleri atlayın.
if (info.GetCustomAttribute<ObsoleteAttribute>() != null)
@SamedBll
SamedBll / FramedText.cs
Created August 2, 2017 15:10
B(C) - 19
public class FramedText : ContentPage
{
public FramedText()
{
Padding = new Thickness(20);
Content = new Frame
{
OutlineColor = Color.Accent,
Content = new Label
{
@SamedBll
SamedBll / FramedText.cs
Created August 2, 2017 15:17
B(C) - 19 - 2
public class FramedText : ContentPage
{
public FramedText()
{
BackgroundColor = Color.Aqua;
Content = new Frame
{
OutlineColor = Color.Black,
BackgroundColor = Color.Yellow,
@SamedBll
SamedBll / FramedText.cs
Created August 2, 2017 15:27
B(C) - 19 - 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using Xamarin.Forms;
namespace App1
class AIPage : ContentPage
{
public AIPage()
{
StackLayout mainStack = new StackLayout();
StackLayout textStack = new StackLayout
{
Padding = new Thickness(5),
Spacing = 10
};