Skip to content

Commit

Permalink
refactor: Add x:DataType to xaml pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cdefgah committed Jan 29, 2025
1 parent 6dc3b78 commit 1dd41fc
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 5 deletions.
3 changes: 3 additions & 0 deletions MAUI.FreakyControls/Samples/Checkboxes/CheckboxesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:constants="clr-namespace:Samples"
xmlns:freakyControls="clr-namespace:Maui.FreakyControls;assembly=Maui.FreakyControls"
xmlns:vm="clr-namespace:Samples.Checkboxes"
x:DataType="vm:CheckboxesViewModel"
Title="CheckboxesView">

<ContentPage.Resources>
<Style TargetType="freakyControls:FreakyChip">
<Setter Property="Padding" Value="10" />
Expand Down
5 changes: 3 additions & 2 deletions MAUI.FreakyControls/Samples/ImageViews/ImagesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
xmlns:freakyControls="clr-namespace:Maui.FreakyControls;assembly=Maui.FreakyControls"
xmlns:samples="clr-namespace:Samples"
xmlns:vm="clr-namespace:Samples.ImageViews"
Title="ImageViews"
x:DataType="vm:ImagesViewModel">
x:DataType="vm:ImagesViewModel"
Title="ImageViews">

<ScrollView>
<VerticalStackLayout Padding="30" Spacing="10">

Expand Down
3 changes: 3 additions & 0 deletions MAUI.FreakyControls/Samples/Pickers/PickersView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:freakyControls="clr-namespace:Maui.FreakyControls;assembly=Maui.FreakyControls"
xmlns:vm="clr-namespace:Samples.Pickers"
x:DataType="vm:PickersViewModel"
Title="PickersView">

<VerticalStackLayout Padding="30" Spacing="10">
<Label Text="Freaky DatePicker below: " TextColor="Black" />
<Border>
Expand Down
2 changes: 1 addition & 1 deletion MAUI.FreakyControls/Samples/Pickers/PickersView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ public partial class PickersView : ContentPage
public PickersView()
{
InitializeComponent();
this.BindingContext = new PickersViewModel();
BindingContext = new PickersViewModel();
}
}
4 changes: 4 additions & 0 deletions MAUI.FreakyControls/Samples/PinView/PinView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:freakyControls="clr-namespace:Maui.FreakyControls;assembly=Maui.FreakyControls"
xmlns:vm="clr-namespace:Samples.PinView"
x:DataType="vm:PinViewModel"
Title="PinView">


<Grid RowDefinitions="*,Auto,4*">

<Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:freakyControls="clr-namespace:Maui.FreakyControls;assembly=Maui.FreakyControls"
xmlns:samples="clr-namespace:Samples"
xmlns:vm="clr-namespace:Samples.RadioButtons"
x:DataType="vm:RadioButtonsViewModel"
Title="RadioButtonsView">

<VerticalStackLayout
Padding="30"
HorizontalOptions="Center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:samples="clr-namespace:Samples.SignatureView"
Title="SignatureView"
x:DataType="samples:SignatureViewModel">

<Grid Padding="5" RowDefinitions="*, Auto">
<freakyControls:FreakySignaturePadView
x:Name="svgPad"
Expand Down
5 changes: 4 additions & 1 deletion MAUI.FreakyControls/Samples/Switch/SwitchsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:freakyControls="clr-namespace:Maui.FreakyControls;assembly=Maui.FreakyControls"
Title="Switchs">
xmlns:vm="clr-namespace:Samples.Switch"
x:DataType="vm:SwitchesViewModel"
Title="Switches">

<VerticalStackLayout
HorizontalOptions="Center"
Spacing="10"
Expand Down
3 changes: 3 additions & 0 deletions MAUI.FreakyControls/Samples/ZoomImage/ZoomImageView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
x:Class="Samples.ZoomImage.ZoomImageView"
xmlns:sample="clr-namespace:Samples"
xmlns:freakyControls="clr-namespace:Maui.FreakyControls;assembly=Maui.FreakyControls"
xmlns:vm="clr-namespace:Samples.ZoomImage"
x:DataType="vm:ZoomImageViewModel"
Title="ZoomImageView">

<Grid BackgroundColor="#88000000">
<freakyControls:FreakyZoomableView>
<Image Aspect="AspectFit" Source="{x:Static sample:ImageUrls.Female1}"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
namespace Samples.ZoomImage;

public class ZoomImageViewModel
Expand Down

0 comments on commit 1dd41fc

Please sign in to comment.