Skip to content

Commit

Permalink
Fix DataType
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavAntonyuk committed Feb 25, 2024
1 parent 608a373 commit 48fc032
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 20 deletions.
3 changes: 3 additions & 0 deletions BottomSheet/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:bottomSheet="clr-namespace:BottomSheet"
x:Class="BottomSheet.MainPage">

<ContentPage.Resources>
<DataTemplate x:Name="BottomSheetTemplate" x:Key="BottomSheetTemplate">
<ScrollView>
<VerticalStackLayout
x:DataType="bottomSheet:MainPage"
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
Expand Down Expand Up @@ -42,6 +44,7 @@
<DataTemplate x:Name="BottomSheetTemplateWithLongContent" x:Key="BottomSheetTemplateWithLongContent">
<ScrollView>
<VerticalStackLayout
x:DataType="bottomSheet:MainPage"
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
Expand Down
Binary file modified LocalPackages/VladislavAntonyuk.MaterialCalendarView.1.9.0.nupkg
Binary file not shown.
4 changes: 2 additions & 2 deletions MauiBank/Views/CardPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
</CollectionView.Header>

<CollectionView.GroupHeaderTemplate>
<DataTemplate>
<DataTemplate x:DataType="models:TransactionGroup">
<Grid>
<Label Text="{Binding Date, StringFormat='{0:dd MMMM yyyy}'}"
HorizontalOptions="Center" />
Expand All @@ -211,7 +211,7 @@
</CollectionView.GroupHeaderTemplate>

<CollectionView.ItemTemplate>
<DataTemplate>
<DataTemplate x:DataType="models:Transaction">
<Grid ColumnDefinitions="50,*,0.2*" RowDefinitions="*,*" Margin="30,10">
<Label Grid.Row="0" Grid.Column="0" Grid.RowSpan="2"
Text="{x:Static fonts:FontAwesomeIcons.PaperPlane}"
Expand Down
4 changes: 3 additions & 1 deletion MauiBank/Views/ProfilePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
<views:BasePage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:MauiBank.Views"
xmlns:viewModels="clr-namespace:MauiBank.ViewModels"
x:Class="MauiBank.Views.ProfilePage"
Shell.PresentationMode="ModalAnimated"
x:DataType="viewModels:ProfilePageViewModel"
Title="ProfilePage">
<VerticalStackLayout>
<Label
Text="In development"
VerticalOptions="Center"
HorizontalOptions="Center" />

<Button Text="back" Command="{Binding BackCommand}"/>
<Button Text="Back" Command="{Binding BackCommand}"/>
</VerticalStackLayout>
</views:BasePage>
6 changes: 4 additions & 2 deletions MauiBluetooth/DetailsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<views:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="MauiBluetooth.DetailsPage">
xmlns:mauiBluetooth="clr-namespace:MauiBluetooth"
x:Class="MauiBluetooth.DetailsPage"
x:DataType="mauiBluetooth:DetailsPage">

<VerticalStackLayout>
<Label Text="{Binding device.Name}" />
<Label Text="{Binding Device.Name}" />
<Button Text="Get Services" Clicked="GetServices" />
<Button Text="Send message" Clicked="SendMessage" />
</VerticalStackLayout>
Expand Down
12 changes: 6 additions & 6 deletions MauiBluetooth/DetailsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

public partial class DetailsPage : Popup
{
private readonly IDevice device;
public IDevice Device { get; }
private readonly IBluetoothService bluetoothService;

public DetailsPage(IDevice device, IBluetoothService bluetoothService)
{
this.device = device;
Device = device;
this.bluetoothService = bluetoothService;
InitializeComponent();
BindingContext = this;
Expand All @@ -21,7 +21,7 @@ public DetailsPage(IDevice device, IBluetoothService bluetoothService)

private async void GetServices(object sender, EventArgs e)
{
var services = await device.GetServicesAsync();
var services = await Device.GetServicesAsync();
var service = services.First();
var characteristics = await service.GetCharacteristicsAsync();
var characteristic = characteristics.First();
Expand All @@ -40,10 +40,10 @@ private async void GetServices(object sender, EventArgs e)

private async void SendMessage(object sender, EventArgs e)
{
await bluetoothService.Connect(device.Name);
await bluetoothService.Send(device.Name, Encoding.Default.GetBytes("test"));
await bluetoothService.Connect(Device.Name);
await bluetoothService.Send(Device.Name, Encoding.Default.GetBytes("test"));

var data = await bluetoothService.Receive(device.Name);
var data = await bluetoothService.Receive(Device.Name);
await Toast.Make(Encoding.Default.GetString(data)).Show();
await bluetoothService.Disconnect();
}
Expand Down
7 changes: 4 additions & 3 deletions MauiBluetooth/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:contracts="clr-namespace:Plugin.BLE.Abstractions.Contracts;assembly=Plugin.BLE.Abstractions"
xmlns:mauiBluetooth="clr-namespace:MauiBluetooth"
xmlns:contracts="clr-namespace:Plugin.BLE.Abstractions.Contracts;assembly=Plugin.BLE"
x:Class="MauiBluetooth.MainPage"
Shell.NavBarIsVisible="False"
x:DataType="mauiBluetooth:MainPageViewModel"
x:Name="Main">
<CollectionView ItemsSource="{Binding Devices}">
<CollectionView.Header>
<Button Command="{Binding ScanDevicesCommand}"
Text="Scan devices" />
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="*, Auto" Grid.RowDefinitions="*,*">
<DataTemplate x:DataType="contracts:IDevice">
<Grid ColumnDefinitions="*, Auto" RowDefinitions="*,*">
<Label Grid.Column="0" Text="{Binding NativeDevice.Name}"/>
<Label Grid.Column="0" Grid.Row="1" Text="{Binding NativeDevice.Address}" />
<Button Grid.Column="1" Grid.RowSpan="2" x:DataType="mauiBluetooth:MainPageViewModel"
Expand Down
1 change: 1 addition & 0 deletions MauiMarkdown/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
HeightRequest="10"/>

<mauiMarkdown:MarkdownGraphicsView
x:DataType="Editor"
Grid.Row="2"
BindingContext="{Binding Source={x:Reference Editor}}"
Text="{Binding Text}"
Expand Down
2 changes: 2 additions & 0 deletions MauiPaint/PreviewImage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<mct:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:mauiPaint="using:MauiPaint"
x:Class="MauiPaint.PreviewImage"
x:DataType="mauiPaint:PreviewImage"
Color="Transparent">

<ScrollView>
Expand Down
10 changes: 6 additions & 4 deletions MauiShellCustomization/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
<ToolbarItem Text="Toolbar 2"
IconImageSource="dotnet_bot.png"/>
</Shell.ToolbarItems>
<local:CustomTabBar CenterViewText="+"
CenterViewVisible="True"
CenterViewBackgroundColor="Red"
CenterViewCommand="{Binding CenterViewCommand}">
<local:CustomTabBar
x:DataType="local:AppShell"
CenterViewText="+"
CenterViewVisible="True"
CenterViewBackgroundColor="Red"
CenterViewCommand="{Binding CenterViewCommand}">
<!-- <local:CustomTabBar.CenterViewImageSource> -->
<!-- <FileImageSource File="dotnet_bot.png"></FileImageSource> -->
<!-- </local:CustomTabBar.CenterViewImageSource> -->
Expand Down
1 change: 0 additions & 1 deletion MauiShellCustomization/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ public AppShell()
}

public ICommand CenterViewCommand { get; } = new Command(async () => await Toast.Make("CenterViewCommand invoked!").Show());

}
1 change: 1 addition & 0 deletions MauiSpeech/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mauiSpeech="clr-namespace:MauiSpeech"
x:DataType="mauiSpeech:MainViewModel"
x:Class="MauiSpeech.MainPage">

<ContentPage.Resources>
Expand Down
3 changes: 2 additions & 1 deletion MauiTabView/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
</ControlTemplate>

<DataTemplate x:Key="IndicatorDataTemplate">
<VerticalStackLayout>
<VerticalStackLayout
x:DataType="mauiTabView:Tab">
<Image Source="{Binding Icon}"
WidthRequest="30"
HeightRequest="30"
Expand Down

0 comments on commit 48fc032

Please sign in to comment.