-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainPage.xaml
85 lines (80 loc) · 3.32 KB
/
MainPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?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"
Shell.NavBarIsVisible="True"
xmlns:model="clr-namespace:UdpQuickShare.ViewModels"
xmlns:local="clr-namespace:UdpQuickShare"
x:Class="UdpQuickShare.MainPage">
<ContentPage.BindingContext>
<model:MainPageViewModel />
</ContentPage.BindingContext>
<Shell.TitleView>
<HorizontalStackLayout>
<Label x:Name="Device"
TextColor="{Binding CurrentDeviceTextColor}"
VerticalTextAlignment="Center"
Text="{Binding CurrentDevice}"
>
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ToggleExposeCommand}"/>
</Label.GestureRecognizers>
</Label>
<Label
TextColor="White"
VerticalTextAlignment="Center"
Text="-->"
/>
<Button Text="{Binding TargetDevice}"
x:Name="OtherDevice"
Command="{Binding ChooseDeviceCommand}"/>
</HorizontalStackLayout>
</Shell.TitleView>
<ScrollView>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
<ListView x:Name="MessageList"
IsVisible="false"
ItemsSource="{Binding Messages}"
SelectionMode="None"
HeightRequest="300"
RowHeight="50">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding}"
MaxLines="4"/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Label Text="发送文本"/>
<Border >
<Entry x:Name="StringSender"
ReturnCommand="{Binding SendTextCommand}"
ReturnCommandParameter="{Binding Source={x:Reference StringSender},Path=Text}"/>
</Border>
<Button Text="发送图片"
x:Name="SendImages"
IsEnabled="{Binding CanSend}"
Command="{Binding SendImageCommand}"/>
<Button Text="发送音频"
x:Name="SendAudios"
IsEnabled="{Binding CanSend}"
Command="{Binding SendAudioCommand}"/>
<Button Text="发送视频"
x:Name="SendVideos"
IsEnabled="{Binding CanSend}"
Command="{Binding SendVideoCommand}"/>
<Button Text="发送其他"
x:Name="SendOthers"
IsEnabled="{Binding CanSend}"
Command="{Binding SendOtherCommand}"/>
<Button Text="发送多个"
x:Name="SendMulti"
IsEnabled="{Binding CanSend}"
Command="{Binding SendMultiCommand}"/>
</VerticalStackLayout>
</ScrollView>
</ContentPage>