-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ProductView2 with markup from TemplateStudio
- Loading branch information
1 parent
d4ee1ec
commit eadcd92
Showing
4 changed files
with
188 additions
and
2 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
106 changes: 106 additions & 0 deletions
106
src/Inventory.Presentation/Views/Product/ProductView2.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,106 @@ | ||
<Page | ||
x:Class="Inventory.Presentation.Views.Product.ProductView2" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Inventory.Presentation.Views.Product" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid x:Name="ContentArea"> | ||
|
||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup> | ||
<VisualState> | ||
<VisualState.StateTriggers> | ||
<!--641 is the default CompactModeThresholdWidth in NavigationView --> | ||
<AdaptiveTrigger MinWindowWidth="641" /> | ||
</VisualState.StateTriggers> | ||
<VisualState.Setters> | ||
<Setter Target="propertiesGroup1.(RelativePanel.RightOf)" Value="itemHero" /> | ||
<Setter Target="propertiesGroup1.(RelativePanel.Below)" Value="title" /> | ||
<Setter Target="propertiesGroup2.(RelativePanel.RightOf)" Value="propertiesGroup1" /> | ||
<Setter Target="propertiesGroup2.(RelativePanel.Below)" Value="title" /> | ||
<Setter Target="propertiesGroup1.Width" Value="200" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
|
||
<ScrollViewer | ||
IsTabStop="True"> | ||
<StackPanel | ||
x:Name="contentPanel"> | ||
<RelativePanel> | ||
<Grid | ||
x:Name="itemHero" | ||
Width="200" | ||
Height="200" | ||
Margin="{StaticResource SmallRightMargin}" | ||
Padding="{StaticResource XSmallLeftTopRightBottomMargin}" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
RelativePanel.AlignTopWithPanel="True" | ||
RelativePanel.AlignLeftWithPanel="True"> | ||
<FontIcon | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
FontSize="70" | ||
Glyph="{x:Bind ViewModel.Symbol}" | ||
AutomationProperties.Name="{x:Bind ViewModel.SymbolName}" /> | ||
</Grid> | ||
|
||
<TextBlock | ||
x:Name="title" | ||
Margin="{StaticResource XXSmallTopMargin}" | ||
RelativePanel.AlignTopWithPanel="True" | ||
RelativePanel.RightOf="itemHero" | ||
Style="{ThemeResource TitleTextBlockStyle}" | ||
Text="{x:Bind ViewModel.Company, Mode=OneWay}" /> | ||
|
||
<StackPanel x:Name="propertiesGroup1" RelativePanel.Below="itemHero"> | ||
<StackPanel x:Name="statusGroup" Margin="{StaticResource SmallTopMargin}"> | ||
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}" Text="Status" /> | ||
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind ViewModel.Status}" /> | ||
</StackPanel> | ||
|
||
<StackPanel x:Name="orderDateGroup" Margin="{StaticResource SmallTopMargin}"> | ||
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}" Text="Order date" /> | ||
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind ViewModel.OrderDate}" /> | ||
</StackPanel> | ||
</StackPanel> | ||
|
||
<StackPanel x:Name="propertiesGroup2" RelativePanel.Below="propertiesGroup1"> | ||
<StackPanel x:Name="shipToGroup" Margin="{StaticResource SmallTopMargin}"> | ||
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}" Text="Ship to" /> | ||
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind ViewModel.ShipTo}" /> | ||
</StackPanel> | ||
|
||
<StackPanel x:Name="orderTotalGroup" Margin="{StaticResource SmallTopMargin}"> | ||
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}" Text="Order total" /> | ||
<TextBlock Style="{ThemeResource BodyTextBlockStyle}" Text="{x:Bind ViewModel.OrderTotal}" /> | ||
</StackPanel> | ||
</StackPanel> | ||
|
||
</RelativePanel> | ||
|
||
<TextBlock | ||
Margin="{StaticResource SmallTopMargin}" | ||
Style="{ThemeResource SubtitleTextBlockStyle}" | ||
Text="Note 1" /> | ||
<TextBlock | ||
Style="{ThemeResource BodyTextBlockStyle}" | ||
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis hendrerit nulla, vel molestie libero. In nec ultricies magna, ultricies molestie ipsum. Mauris non dignissim velit. Etiam malesuada blandit mauris eu maximus. Quisque ornare, felis nec scelerisque mollis, risus dolor posuere magna, in gravida quam mi id nisi. Nullam mattis consequat ex. Cras nulla neque, dictum ac urna et, vestibulum feugiat ex. Pellentesque malesuada accumsan ligula, vel fringilla lacus facilisis sit amet. Proin convallis tempor arcu, ac placerat libero pretium ut. Praesent hendrerit nisl at lobortis viverra. Fusce vitae velit odio. Nam ut tortor sed purus finibus sollicitudin quis at ante. Ut sodales dolor vel eros mollis suscipit. Donec eu nulla id urna ultricies consequat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;" /> | ||
|
||
<TextBlock | ||
Margin="{StaticResource SmallTopMargin}" | ||
Style="{ThemeResource SubtitleTextBlockStyle}" | ||
Text="Note 2" /> | ||
<TextBlock | ||
Margin="{StaticResource MediumBottomMargin}" | ||
Style="{ThemeResource BodyTextBlockStyle}" | ||
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis hendrerit nulla, vel molestie libero. In nec ultricies magna, ultricies molestie ipsum. Mauris non dignissim velit. Etiam malesuada blandit mauris eu maximus. Quisque ornare, felis nec scelerisque mollis, risus dolor posuere magna, in gravida quam mi id nisi. Nullam mattis consequat ex. Cras nulla neque, dictum ac urna et, vestibulum feugiat ex. Pellentesque malesuada accumsan ligula, vel fringilla lacus facilisis sit amet. Proin convallis tempor arcu, ac placerat libero pretium ut. Praesent hendrerit nisl at lobortis viverra. Fusce vitae velit odio. Nam ut tortor sed purus finibus sollicitudin quis at ante. Ut sodales dolor vel eros mollis suscipit. Donec eu nulla id urna ultricies consequat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;" /> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</Grid> | ||
</Page> |
71 changes: 71 additions & 0 deletions
71
src/Inventory.Presentation/Views/Product/ProductView2.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,71 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Inventory.Application.Models; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Inventory.Presentation.Views.Product; | ||
|
||
public sealed partial class ProductView2 : Page | ||
{ | ||
public ProductView2() | ||
{ | ||
InitializeComponent(); | ||
ViewModel = new SampleOrder() | ||
{ | ||
OrderID = 10643, // Symbol Globe | ||
OrderDate = new DateTime(1997, 8, 25), | ||
RequiredDate = new DateTime(1997, 9, 22), | ||
ShippedDate = new DateTime(1997, 9, 22), | ||
ShipperName = "Speedy Express", | ||
ShipperPhone = "(503) 555-9831", | ||
Freight = 29.46, | ||
Company = "Company A", | ||
ShipTo = "Company A, Obere Str. 57, Berlin, 12209, Germany", | ||
OrderTotal = 814.50, | ||
Status = "Shipped", | ||
SymbolCode = 57643, | ||
SymbolName = "Globe", | ||
Details = new List<SampleOrderDetail>() | ||
{ | ||
new() | ||
{ | ||
ProductID = 28, | ||
ProductName = "Rössle Sauerkraut", | ||
Quantity = 15, | ||
Discount = 0.25, | ||
QuantityPerUnit = "25 - 825 g cans", | ||
UnitPrice = 45.60, | ||
CategoryName = "Produce", | ||
CategoryDescription = "Dried fruit and bean curd", | ||
Total = 513.00, | ||
}, | ||
new() | ||
{ | ||
ProductID = 39, | ||
ProductName = "Chartreuse verte", | ||
Quantity = 21, | ||
Discount = 0.25, | ||
QuantityPerUnit = "750 cc per bottle", | ||
UnitPrice = 18.0, | ||
CategoryName = "Beverages", | ||
CategoryDescription = "Soft drinks, coffees, teas, beers, and ales", | ||
Total = 283.50, | ||
}, | ||
new() | ||
{ | ||
ProductID = 46, | ||
ProductName = "Spegesild", | ||
Quantity = 2, | ||
Discount = 0.25, | ||
QuantityPerUnit = "4 - 450 g glasses", | ||
UnitPrice = 12.0, | ||
CategoryName = "Seafood", | ||
CategoryDescription = "Seaweed and fish", | ||
Total = 18.00, | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
private SampleOrder ViewModel { get; } | ||
} |