-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #860 from unoplatform/dev/erli/update-nav-sample-t…
…ofromquery chore: Adjust nav sample to properly navigate with to from query
- Loading branch information
Showing
7 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
UI/Navigation/src/Navigation/Presentation/ToFromQuery/ToFromQueryMainPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<Page x:Class="Navigation.Presentation.ToFromQueryMainPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Navigation.Presentation" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
xmlns:uen="using:Uno.Extensions.Navigation.UI" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
|
||
<utu:NavigationBar Content="FromQuery/ToQuery Page"> | ||
<utu:NavigationBar.MainCommand> | ||
<AppBarButton> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/Images/back.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</utu:NavigationBar.MainCommand> | ||
</utu:NavigationBar> | ||
|
||
<StackPanel Grid.Row="1" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Spacing="16"> | ||
<Image Width="150" | ||
Height="150" | ||
Margin="12" | ||
HorizontalAlignment="Center" | ||
Source="ms-appx:///Assets/logo.png" /> | ||
|
||
<Button Content="See User 1" | ||
HorizontalAlignment="Center" | ||
uen:Navigation.Data="{Binding User1}" | ||
uen:Navigation.Request="ToFromQuery" /> | ||
|
||
<Button Content="See User 2" | ||
HorizontalAlignment="Center" | ||
uen:Navigation.Data="{Binding User2}" | ||
uen:Navigation.Request="ToFromQuery" /> | ||
|
||
</StackPanel> | ||
</Grid> | ||
</Page> |
9 changes: 9 additions & 0 deletions
9
UI/Navigation/src/Navigation/Presentation/ToFromQuery/ToFromQueryMainPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Navigation.Presentation; | ||
|
||
public sealed partial class ToFromQueryMainPage : Page | ||
{ | ||
public ToFromQueryMainPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
UI/Navigation/src/Navigation/Presentation/ToFromQuery/ToFromQueryMainViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Navigation.Presentation; | ||
|
||
public partial class ToFromQueryMainViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] | ||
private IDictionary<string, object> user1; | ||
|
||
[ObservableProperty] | ||
private IDictionary<string, object> user2; | ||
|
||
public ToFromQueryMainViewModel() | ||
{ | ||
User1 = new Dictionary<string, object> | ||
{ | ||
{ "QueryUser.Id", Guid.Parse("8a5c5b2e-ff96-474b-9e4d-65bde598f6bc") } | ||
}; | ||
|
||
User2 = new Dictionary<string, object> | ||
{ | ||
{ "QueryUser.Id", Guid.Parse("2b64071a-2c8a-45e4-9f48-3eb7d7aace41") } | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters