Skip to content

Commit 21672d5

Browse files
committed
Add stuff
1 parent 27ace73 commit 21672d5

File tree

4 files changed

+75
-51
lines changed

4 files changed

+75
-51
lines changed

Aldeo/App.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public App()
4040
this.Suspending += OnSuspending;
4141
}
4242

43-
private async void Connect() {
43+
private void Connect() {
4444
//await client.LoginAsync ("toto42", "toto42").ConfigureAwait (false);
4545

4646
}

Aldeo/View/MainPage.xaml

+46-24
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@
66
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
88
xmlns:view="using:Aldeo.View"
9+
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
910
DataContext="{Binding Main, Source={StaticResource Locator}}"
1011
mc:Ignorable="d">
1112

13+
<Page.Resources>
14+
<DataTemplate x:Key="MenuTemplate">
15+
<Grid VerticalAlignment="Stretch">
16+
<view:MenuTile Margin="5" />
17+
</Grid>
18+
</DataTemplate>
19+
</Page.Resources>
20+
1221
<interactivity:Interaction.Behaviors>
1322
<core:EventTriggerBehavior EventName="Loaded">
1423
<core:InvokeCommandAction Command="{Binding LoadedCommand}" />
@@ -24,7 +33,25 @@
2433
<!--<TextBlock FontSize="50" Text="{Binding Message}" />-->
2534
<view:Header Title="Aldeo" />
2635

27-
<GridView x:Name="MenuView"
36+
37+
<!--ItemHeight="{Binding ItemHeight.Value}"-->
38+
<!--DesiredWidth="{Binding DesiredWidth.Value}"-->
39+
<!--SelectionMode="{Binding SelectionMode.Value,Mode=TwoWay}"-->
40+
41+
<controls:AdaptiveGridView
42+
Grid.Row="1"
43+
x:Name="MenuView"
44+
IsItemClickEnabled="True"
45+
ItemTemplate="{StaticResource MenuTemplate}"
46+
ItemsSource="{Binding Menu}">
47+
<interactivity:Interaction.Behaviors>
48+
<core:EventTriggerBehavior EventName="SelectionChanged">
49+
<core:InvokeCommandAction Command="{Binding ChangedSelection}" CommandParameter="{Binding SelectedItem, ElementName=MenuView}" />
50+
</core:EventTriggerBehavior>
51+
</interactivity:Interaction.Behaviors>
52+
</controls:AdaptiveGridView>
53+
54+
<!--<GridView x:Name="MenuView"
2855
Grid.Row="1"
2956
Margin="15"
3057
HorizontalContentAlignment="Stretch"
@@ -33,38 +60,33 @@
3360
ItemsSource="{Binding Menu}">
3461
3562
36-
<GridView.ItemTemplate>
37-
<DataTemplate>
38-
<Grid VerticalAlignment="Stretch">
39-
<view:MenuTile Margin="5" />
63+
<GridView.ItemTemplate>
64+
<DataTemplate>
65+
<Grid VerticalAlignment="Stretch">
66+
<view:MenuTile Margin="5" />
67+
</Grid>
68+
</DataTemplate>
69+
</GridView.ItemTemplate>-->
4070

41-
</Grid>
42-
</DataTemplate>
43-
</GridView.ItemTemplate>
4471

45-
<interactivity:Interaction.Behaviors>
46-
<core:EventTriggerBehavior EventName="SelectionChanged">
47-
<core:InvokeCommandAction Command="{Binding ChangedSelection}" CommandParameter="{Binding SelectedItem, ElementName=MenuView}" />
48-
</core:EventTriggerBehavior>
49-
</interactivity:Interaction.Behaviors>
5072

51-
<!--<GridView.ItemsPanel>
73+
<!--<GridView.ItemsPanel>
5274
<ItemsPanelTemplate>
5375
<WrapGrid Orientation="Horizontal" VerticalChildrenAlignment="Stretch"/>
5476
</ItemsPanelTemplate>-->
5577

56-
<!--<GridView.ItemsPanel>
78+
<!--<GridView.ItemsPanel>
5779
5880
<ItemsPanelTemplate>
5981
<WrapGrid />
6082
-->
61-
<!-- Orientation=&quot;Horizontal&quot;/&gt; -->
83+
<!-- Orientation=&quot;Horizontal&quot;/&gt; -->
6284

63-
<!--</ItemsPanelTemplate>-->
85+
<!--</ItemsPanelTemplate>-->
6486

65-
<!--</GridView.ItemsPanel>-->
87+
<!--</GridView.ItemsPanel>-->
6688

67-
<!--<StackPanel x:Name="myPanel" Orientation="Vertical">
89+
<!--<StackPanel x:Name="myPanel" Orientation="Vertical">
6890
<TextBlock Text="This is a block of text. It is text block 1. "
6991
Style="{ThemeResource BodyTextBlockStyle}"/>
7092
<TextBlock Text="This is a block of text. It is text block 2. "
@@ -73,7 +95,7 @@
7395
Style="{ThemeResource BodyTextBlockStyle}"/>
7496
</StackPanel>-->
7597

76-
</GridView>
98+
<!--</GridView>-->
7799
<CommandBar Grid.Row="1" VerticalAlignment="Bottom">
78100
<!--<AppBarToggleButton Icon="Shuffle" Label="Shuffle" Click="AppBarButton_Click" />
79101
<AppBarToggleButton Icon="RepeatAll" Label="Repeat" Click="AppBarButton_Click"/>
@@ -116,10 +138,10 @@
116138
</VisualState>
117139
</VisualStateGroup>
118140
</VisualStateManager.VisualStateGroups>-->
119-
<view:Bot Grid.Row="2" HorizontalAlignment="Stretch" MaxWidth="720" VerticalAlignment="Bottom">
120-
121-
</view:Bot>
122-
141+
<view:Bot Grid.Row="2" HorizontalAlignment="Stretch" MaxWidth="720" VerticalAlignment="Bottom">
142+
143+
</view:Bot>
144+
123145
</Grid>
124146

125147
</Page>

Aldeo/ViewModel/DictionaryViewModel.cs

+27-26
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Windows.ApplicationModel.Core;
1010
using Windows.UI.Core;
1111
using Windows.UI.Popups;
12+
using Windows.UI.ViewManagement;
1213
using GalaSoft.MvvmLight;
1314
using GalaSoft.MvvmLight.Command;
1415
using GalaSoft.MvvmLight.Messaging;
@@ -32,22 +33,22 @@ public DictionaryViewModel() {
3233
Url = "";
3334
}
3435

35-
private async void LoadedExecute() {
36-
try
37-
{
36+
private /*async*/ void LoadedExecute() {
37+
//try
38+
//{
3839
return;
39-
await Co().ConfigureAwait (false);
40-
await Task.Run(() =>
41-
{
42-
Messenger.Default.Register<string> (this, SearchClickedExecute);
43-
Debug.WriteLine ("connected");
44-
}).ConfigureAwait(false);
40+
// await Co().ConfigureAwait (false);
41+
// await Task.Run(() =>
42+
// {
43+
// Messenger.Default.Register<string> (this, SearchClickedExecute);
44+
// Debug.WriteLine ("connected");
45+
// }).ConfigureAwait(false);
4546

46-
}
47-
catch (Exception)
48-
{
49-
throw;
50-
}
47+
//}
48+
//catch (Exception)
49+
//{
50+
// throw;
51+
//}
5152
}
5253

5354
private Task Co()
@@ -60,22 +61,22 @@ private async void SearchClickedExecute(string input) {
6061
try
6162
{
6263
return;
63-
var result = await client.GetDictionaryDefintionAsync (input).ConfigureAwait (false);
64+
//var result = await client.GetDictionaryDefintionAsync (input).ConfigureAwait (false);
6465

65-
var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
66+
//var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
6667

67-
await dispatcher.RunAsync (CoreDispatcherPriority.Normal, () => {
68-
Title = result.Title;
69-
Answer = result.Extract;
70-
//Url = result.DetailUrl;
71-
//RaisePropertyChanged (() => Title);
72-
//RaisePropertyChanged (() => Answer);
68+
//await dispatcher.RunAsync (CoreDispatcherPriority.Normal, () => {
69+
// Title = result.Title;
70+
// Answer = result.Extract;
71+
// //Url = result.DetailUrl;
72+
// //RaisePropertyChanged (() => Title);
73+
// //RaisePropertyChanged (() => Answer);
7374

74-
RaisePropertyChanged ("Title");
75-
RaisePropertyChanged ("Answer");
75+
// RaisePropertyChanged ("Title");
76+
// RaisePropertyChanged ("Answer");
7677

77-
//RaisePropertyChanged (() => Url);
78-
});
78+
// //RaisePropertyChanged (() => Url);
79+
//});
7980

8081
}
8182
catch (Exception ex) {

Aldeo/project.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"Microsoft.ApplicationInsights.PersistenceChannel": "1.0.0",
55
"Microsoft.ApplicationInsights.WindowsApps": "1.0.0",
66
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
7+
"Microsoft.Toolkit.Uwp.UI.Controls": "1.1.0",
78
"MvvmLight": "5.2.0",
89
"Newtonsoft.Json": "8.0.2",
910
"winrtxamltoolkit": "2.0.0"

0 commit comments

Comments
 (0)