This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App : Application | |
{ | |
public App () | |
{ | |
// The root page of your application | |
MainPage = new NavigationPage(new TestSwitchCell.MainPage()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.ObjectModel; | |
using System.Collections.Specialized; | |
using Xamarin.Forms; | |
using XLabs; | |
using XLabs.Forms.Controls; | |
namespace MyNamespace.Custom_Controls | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<T> FindVisualChildren<T>(DependencyObject depObj) where T : DependencyObject | |
{ | |
if (depObj != null) | |
{ | |
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++) | |
{ | |
DependencyObject child = VisualTreeHelper.GetChild(depObj, i); | |
if (child is T) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ObservableCollection<string> ComboBoxItems {get;set;} | |
public MainWindow() | |
{ | |
ComboBoxItems = new ObservableCollection<string>(); | |
ComboBoxItems.Add("one"); | |
ComboBoxItems.Add("two"); | |
DataContext = this; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MarkupExtensionReturnType(typeof(ContentControl))] | |
public class RootObject : MarkupExtension | |
{ | |
public override object ProvideValue(IServiceProvider serviceProvider) | |
{ | |
var rootObjectProvider = (IRootObjectProvider)serviceProvider.GetService(typeof(IRootObjectProvider)); | |
return rootObjectProvider?.RootObject; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page x:Class="WpfApplication1.Pages.Home" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mui="http://gu.com/ModernUI" | |
mc:Ignorable="d" | |
d:DesignHeight="300" d:DesignWidth="300" | |
Title="Home"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string MyBoundString { get; set; } | |
public MainWindow() | |
{ | |
MyBoundString = "this is a bound string"; | |
DataContext = this; // the xaml will now look to this class to resolve bindings | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.ObjectModel; | |
using System.Windows; | |
namespace WpfApplication3 | |
{ | |
public partial class MainWindow : Window | |
{ | |
public ObservableCollection<string> Columns { get; set; } | |
public ObservableCollection<string> Items { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid Padding="5,2,5,2" VerticalOptions="CenterAndExpand"> | |
<Grid.RowDefinitions> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
</Grid.RowDefinitions> | |
<ListView ItemsSource="{Binding ActionTypes}" Grid.Row="0"> |