Skip to content

Commit 73cd795

Browse files
committed
Fix Reload Page
1 parent 5bf2c8c commit 73cd795

File tree

2 files changed

+129
-114
lines changed

2 files changed

+129
-114
lines changed

dev/Views/QuranTabViewItem.xaml

Lines changed: 129 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<TabViewItem x:Class="AlAnvar.Views.QuranTabViewItem"
3-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7-
xmlns:table="using:AlAnvar.Database.Tables"
8-
xmlns:views="using:AlAnvar.Views"
9-
x:Name="tabViewItem"
10-
mc:Ignorable="d">
2+
<TabViewItem
3+
x:Class="AlAnvar.Views.QuranTabViewItem"
4+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:table="using:AlAnvar.Database.Tables"
9+
xmlns:views="using:AlAnvar.Views"
10+
x:Name="tabViewItem"
11+
CloseRequested="QuranTabViewItem_CloseRequested"
12+
Loaded="QuranTabViewItem_Loaded"
13+
mc:Ignorable="d">
1114
<TabViewItem.IconSource>
12-
<BitmapIconSource ShowAsMonochrome="False"
13-
UriSource="Assets/Images/quran.png" />
15+
<BitmapIconSource ShowAsMonochrome="False" UriSource="Assets/Images/quran.png" />
1416
</TabViewItem.IconSource>
1517
<TabViewItem.Resources>
16-
<DataTemplate x:Name="QuranItemTemplate"
17-
x:DataType="table:QuranItem">
18-
<views:QuranItemUC AyaDetail="{x:Bind AyaDetail}"
19-
AyahText="{x:Bind AyahText}"
20-
TranslationText="{x:Bind TranslationText}" />
18+
<DataTemplate x:Name="QuranItemTemplate" x:DataType="table:QuranItem">
19+
<views:QuranItemUC
20+
AyaDetail="{x:Bind AyaDetail}"
21+
AyahText="{x:Bind AyahText}"
22+
TranslationText="{x:Bind TranslationText}" />
2123
</DataTemplate>
2224
</TabViewItem.Resources>
2325
<Grid>
@@ -26,31 +28,33 @@
2628
<RowDefinition />
2729
</Grid.RowDefinitions>
2830

29-
<StackPanel Margin="5,0,5,0"
30-
VerticalAlignment="Top">
31+
<StackPanel Margin="5,0,5,0" VerticalAlignment="Top">
3132
<Grid>
3233
<Grid.ColumnDefinitions>
3334
<ColumnDefinition Width="Auto" />
3435
<ColumnDefinition />
3536
<ColumnDefinition Width="2*" />
3637
</Grid.ColumnDefinitions>
37-
<MediaPlayerElement x:Name="mediaPlayerElement"
38-
Grid.Column="2"
39-
HorizontalAlignment="Stretch"
40-
AreTransportControlsEnabled="True"
41-
AutoPlay="False" />
42-
<TextBlock Grid.Column="0"
43-
Margin="10,0"
44-
VerticalAlignment="Center"
45-
Text="قاری" />
46-
<ComboBox x:Name="CmbQari"
47-
Grid.Column="1"
48-
HorizontalAlignment="Stretch"
49-
VerticalAlignment="Center"
50-
ItemsSource="{x:Bind QarisCollection, Mode=OneWay}"
51-
SelectedIndex="{x:Bind QariIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
52-
SelectedItem="{x:Bind CurrentQari, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
53-
SelectionChanged="CmbQari_SelectionChanged">
38+
<MediaPlayerElement
39+
x:Name="mediaPlayerElement"
40+
Grid.Column="2"
41+
HorizontalAlignment="Stretch"
42+
AreTransportControlsEnabled="True"
43+
AutoPlay="False" />
44+
<TextBlock
45+
Grid.Column="0"
46+
Margin="10,0"
47+
VerticalAlignment="Center"
48+
Text="قاری" />
49+
<ComboBox
50+
x:Name="CmbQari"
51+
Grid.Column="1"
52+
HorizontalAlignment="Stretch"
53+
VerticalAlignment="Center"
54+
ItemsSource="{x:Bind QarisCollection, Mode=OneWay}"
55+
SelectedIndex="{x:Bind QariIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
56+
SelectedItem="{x:Bind CurrentQari, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
57+
SelectionChanged="CmbQari_SelectionChanged">
5458
<ComboBox.ItemTemplate>
5559
<DataTemplate x:DataType="table:QuranAudio">
5660
<StackPanel Orientation="Horizontal">
@@ -70,17 +74,19 @@
7074
<ColumnDefinition />
7175
<ColumnDefinition Width="2*" />
7276
</Grid.ColumnDefinitions>
73-
<TextBlock Margin="10,0"
74-
VerticalAlignment="Center"
75-
Text="مترجم" />
76-
<ComboBox x:Name="CmbTranslation"
77-
Grid.Column="1"
78-
HorizontalAlignment="Stretch"
79-
VerticalAlignment="Center"
80-
ItemsSource="{x:Bind TranslationsCollection, Mode=OneWay}"
81-
SelectedIndex="{x:Bind TranslationIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
82-
SelectedItem="{x:Bind CurrentTranslation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
83-
SelectionChanged="CmbTranslation_SelectionChanged">
77+
<TextBlock
78+
Margin="10,0"
79+
VerticalAlignment="Center"
80+
Text="مترجم" />
81+
<ComboBox
82+
x:Name="CmbTranslation"
83+
Grid.Column="1"
84+
HorizontalAlignment="Stretch"
85+
VerticalAlignment="Center"
86+
ItemsSource="{x:Bind TranslationsCollection, Mode=OneWay}"
87+
SelectedIndex="{x:Bind TranslationIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
88+
SelectedItem="{x:Bind CurrentTranslation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
89+
SelectionChanged="CmbTranslation_SelectionChanged">
8490
<ComboBox.ItemTemplate>
8591
<DataTemplate x:DataType="table:QuranTranslation">
8692
<StackPanel Orientation="Horizontal">
@@ -92,91 +98,102 @@
9298
</ComboBox.ItemTemplate>
9399
</ComboBox>
94100

95-
<CommandBar Grid.Column="2"
96-
HorizontalAlignment="Center"
97-
Background="Transparent"
98-
DefaultLabelPosition="Right"
99-
IsOpen="False">
100-
<AppBarToggleButton x:Name="btnShowTranslation"
101-
Checked="OnAppBarToggleButtonChanged"
102-
Icon="Caption"
103-
IsChecked="True"
104-
Label="نمایش ترجمه"
105-
Tag="Translation"
106-
Unchecked="OnAppBarToggleButtonChanged" />
107-
<AppBarToggleButton x:Name="btnShowAya"
108-
Checked="OnAppBarToggleButtonChanged"
109-
Icon="Caption"
110-
IsChecked="True"
111-
Label="نمایش آیه"
112-
Tag="Aya"
113-
Unchecked="OnAppBarToggleButtonChanged" />
101+
<CommandBar
102+
Grid.Column="2"
103+
HorizontalAlignment="Center"
104+
Background="Transparent"
105+
DefaultLabelPosition="Right"
106+
IsOpen="False">
107+
<AppBarToggleButton
108+
x:Name="btnShowTranslation"
109+
Checked="OnAppBarToggleButtonChanged"
110+
Icon="Caption"
111+
IsChecked="True"
112+
Label="نمایش ترجمه"
113+
Tag="Translation"
114+
Unchecked="OnAppBarToggleButtonChanged" />
115+
<AppBarToggleButton
116+
x:Name="btnShowAya"
117+
Checked="OnAppBarToggleButtonChanged"
118+
Icon="Caption"
119+
IsChecked="True"
120+
Label="نمایش آیه"
121+
Tag="Aya"
122+
Unchecked="OnAppBarToggleButtonChanged" />
114123
<AppBarSeparator />
115-
<AppBarButton x:Name="btnNext"
116-
Click="AppBarButton_Click"
117-
Icon="Next"
118-
Label="بعدی"
119-
Tag="Next" />
120-
<AppBarToggleButton x:Name="btnPlay"
121-
Click="AppBarToggleButton_Click"
122-
Icon="Play"
123-
Label="پخش" />
124-
<AppBarButton x:Name="btnPrev"
125-
Click="AppBarButton_Click"
126-
Icon="Previous"
127-
Label="قبلی"
128-
Tag="Previous" />
124+
<AppBarButton
125+
x:Name="btnNext"
126+
Click="AppBarButton_Click"
127+
Icon="Next"
128+
Label="بعدی"
129+
Tag="Next" />
130+
<AppBarToggleButton
131+
x:Name="btnPlay"
132+
Click="AppBarToggleButton_Click"
133+
Icon="Play"
134+
Label="پخش" />
135+
<AppBarButton
136+
x:Name="btnPrev"
137+
Click="AppBarButton_Click"
138+
Icon="Previous"
139+
Label="قبلی"
140+
Tag="Previous" />
129141
</CommandBar>
130142

131143
</Grid>
132144
</Border>
133145

134146
</StackPanel>
135147

136-
<ListView x:Name="quranListView"
137-
Grid.Row="1"
138-
Margin="10"
139-
ItemTemplate="{StaticResource QuranItemTemplate}"
140-
RightTapped="quranListView_RightTapped"
141-
SelectionChanged="quranListView_SelectionChanged">
148+
<ListView
149+
x:Name="quranListView"
150+
Grid.Row="1"
151+
Margin="10"
152+
ItemTemplate="{StaticResource QuranItemTemplate}"
153+
RightTapped="quranListView_RightTapped"
154+
SelectionChanged="quranListView_SelectionChanged">
142155
<ListView.Resources>
143156
<MenuFlyout x:Name="menuFlyout">
144157
<MenuFlyout.Items>
145-
<MenuFlyoutItem x:Name="mnuPlay"
146-
Click="menuFlyout_Click"
147-
Icon="Volume"
148-
Tag="Play"
149-
Text="قرائت" />
158+
<MenuFlyoutItem
159+
x:Name="mnuPlay"
160+
Click="menuFlyout_Click"
161+
Icon="Volume"
162+
Tag="Play"
163+
Text="قرائت" />
150164
<MenuFlyoutSeparator />
151165

152-
<MenuFlyoutItem x:Name="mnuAddNote"
153-
Click="menuFlyout_Click"
154-
Icon="Add"
155-
IsEnabled="False"
156-
Tag="AddNote"
157-
Text="افزودن یادداشت" />
166+
<MenuFlyoutItem
167+
x:Name="mnuAddNote"
168+
Click="menuFlyout_Click"
169+
Icon="Add"
170+
IsEnabled="False"
171+
Tag="AddNote"
172+
Text="افزودن یادداشت" />
158173
<MenuFlyoutSeparator />
159-
<MenuFlyoutSubItem Icon="Copy"
160-
Text="کپی">
161-
<MenuFlyoutItem x:Name="mnuCopyTranslation"
162-
Click="menuFlyout_Click"
163-
Icon="Copy"
164-
Tag="CopyTranslation"
165-
Text="ترجمه" />
166-
<MenuFlyoutItem x:Name="mnuCopyAya"
167-
Click="menuFlyout_Click"
168-
Icon="Copy"
169-
Tag="CopyAya"
170-
Text="آیه" />
174+
<MenuFlyoutSubItem Icon="Copy" Text="کپی">
175+
<MenuFlyoutItem
176+
x:Name="mnuCopyTranslation"
177+
Click="menuFlyout_Click"
178+
Icon="Copy"
179+
Tag="CopyTranslation"
180+
Text="ترجمه" />
181+
<MenuFlyoutItem
182+
x:Name="mnuCopyAya"
183+
Click="menuFlyout_Click"
184+
Icon="Copy"
185+
Tag="CopyAya"
186+
Text="آیه" />
171187
</MenuFlyoutSubItem>
172188
</MenuFlyout.Items>
173189
</MenuFlyout>
174190
</ListView.Resources>
175191
</ListView>
176-
<ProgressRing x:Name="prgLoading"
177-
Grid.Row="1"
178-
HorizontalAlignment="Center"
179-
VerticalAlignment="Center" />
192+
<ProgressRing
193+
x:Name="prgLoading"
194+
Grid.Row="1"
195+
HorizontalAlignment="Center"
196+
VerticalAlignment="Center" />
180197

181198
</Grid>
182199
</TabViewItem>

dev/Views/QuranTabViewItem.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public QuranTabViewItem()
6969
mediaPlayerElement.TransportControls.IsZoomButtonVisible = false;
7070
mediaPlayerElement.TransportControls.IsRepeatButtonVisible = true;
7171
mediaPlayerElement.TransportControls.IsRepeatEnabled = true;
72-
Loaded += QuranTabViewItem_Loaded;
73-
CloseRequested += QuranTabViewItem_CloseRequested;
7472
mediaPlayerElement.MediaPlayer.MediaEnded += MediaPlayer_MediaEnded;
7573
}
7674

0 commit comments

Comments
 (0)