Skip to content

Commit 6c0ef1b

Browse files
authored
Update AcrylicPage.xaml.cs to In line with xaml side change
1 parent aa9f239 commit 6c0ef1b

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Windows/AcrylicPage.xaml.cs

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using iNKORE.UI.WPF.Modern.Controls;
1+
using iNKORE.UI.WPF.Modern.Controls;
22
using iNKORE.UI.WPF.Modern.Media;
33
using System;
44
using System.Collections.Generic;
@@ -14,6 +14,8 @@
1414
using System.Windows.Media.Imaging;
1515
using System.Windows.Navigation;
1616
using System.Windows.Shapes;
17+
using System.Diagnostics;
18+
using iNKORE.UI.WPF.Modern.Gallery.DataModel;
1719
using Page = iNKORE.UI.WPF.Modern.Controls.Page;
1820

1921
namespace iNKORE.UI.WPF.Modern.Gallery.Pages.Controls.Windows
@@ -48,11 +50,39 @@ private void OpacitySliderInApp_ValueChanged(object sender, RoutedPropertyChange
4850
UpdateExampleCode();
4951
}
5052

53+
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
54+
{
55+
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
56+
e.Handled = true;
57+
}
58+
59+
private async void SystemBackdropLink_Click(object sender, RoutedEventArgs e)
60+
{
61+
var realms = await ControlInfoDataSource.Instance.GetRealmsAsync();
62+
var item = realms
63+
.SelectMany(r => r.Groups)
64+
.SelectMany(g => g.Items)
65+
.FirstOrDefault(ci => ci.UniqueId == "SystemBackdrops");
66+
if (item == null) return;
67+
68+
NavigationRootPage.RootFrame.Navigate(ItemPage.Create(item));
69+
}
70+
71+
private void OpacitySliderLumin_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
72+
{
73+
UpdateExampleCode();
74+
}
75+
76+
private void LuminositySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
77+
{
78+
UpdateExampleCode();
79+
}
5180

5281
private void UpdateExampleCode()
5382
{
5483
Example1.Xaml = Example1Xaml;
5584
Example3.Xaml = Example3Xaml;
85+
Example4.Xaml = Example4Xaml;
5686
}
5787

5888
string Example1Xaml => @"
@@ -112,6 +142,43 @@ private void UpdateExampleCode()
112142
TintColor=""${CustomAcrylicShapeInApp.TintColor.ToHEX()}""
113143
TintOpacity=""${CustomAcrylicShapeInApp.TintOpacity.ToString()}"" />
114144
</Grid>
145+
";
146+
147+
string Example4Xaml => $@"
148+
<Grid
149+
x:Name=""Example4Grid""
150+
Width=""320""
151+
Height=""200""
152+
HorizontalAlignment=""Left"">
153+
<Grid x:Name=""Acrylic4Grid""
154+
Background=""{{DynamicResource {{x:Static ui:ThemeKeys.SolidBackgroundFillColorBaseBrushKey}}}}"">
155+
<Rectangle
156+
Width=""100""
157+
Height=""200""
158+
HorizontalAlignment=""Left""
159+
VerticalAlignment=""Top""
160+
Fill=""Aqua"" />
161+
<Ellipse
162+
Width=""152""
163+
Height=""152""
164+
HorizontalAlignment=""Center""
165+
VerticalAlignment=""Center""
166+
Fill=""Magenta"" />
167+
<Rectangle
168+
Width=""80""
169+
Height=""100""
170+
HorizontalAlignment=""Right""
171+
VerticalAlignment=""Bottom""
172+
Fill=""Yellow"" />
173+
</Grid>
174+
<ui:AcrylicPanel
175+
x:Name=""CustomAcrylicShapeLumin""
176+
Margin=""12""
177+
Target=""{{Binding ElementName=Acrylic4Grid}}""
178+
TintColor=""SkyBlue""
179+
TintOpacity=""{CustomAcrylicShapeLumin.TintOpacity.ToString()}""
180+
Amount=""{CustomAcrylicShapeLumin.Amount.ToString()}"" />
181+
</Grid>
115182
";
116183

117184
}

0 commit comments

Comments
 (0)