|
1 | | -using iNKORE.UI.WPF.Modern.Controls; |
| 1 | +using iNKORE.UI.WPF.Modern.Controls; |
2 | 2 | using iNKORE.UI.WPF.Modern.Media; |
3 | 3 | using System; |
4 | 4 | using System.Collections.Generic; |
|
14 | 14 | using System.Windows.Media.Imaging; |
15 | 15 | using System.Windows.Navigation; |
16 | 16 | using System.Windows.Shapes; |
| 17 | +using System.Diagnostics; |
| 18 | +using iNKORE.UI.WPF.Modern.Gallery.DataModel; |
17 | 19 | using Page = iNKORE.UI.WPF.Modern.Controls.Page; |
18 | 20 |
|
19 | 21 | namespace iNKORE.UI.WPF.Modern.Gallery.Pages.Controls.Windows |
@@ -48,11 +50,39 @@ private void OpacitySliderInApp_ValueChanged(object sender, RoutedPropertyChange |
48 | 50 | UpdateExampleCode(); |
49 | 51 | } |
50 | 52 |
|
| 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 | + } |
51 | 80 |
|
52 | 81 | private void UpdateExampleCode() |
53 | 82 | { |
54 | 83 | Example1.Xaml = Example1Xaml; |
55 | 84 | Example3.Xaml = Example3Xaml; |
| 85 | + Example4.Xaml = Example4Xaml; |
56 | 86 | } |
57 | 87 |
|
58 | 88 | string Example1Xaml => @" |
@@ -112,6 +142,43 @@ private void UpdateExampleCode() |
112 | 142 | TintColor=""${CustomAcrylicShapeInApp.TintColor.ToHEX()}"" |
113 | 143 | TintOpacity=""${CustomAcrylicShapeInApp.TintOpacity.ToString()}"" /> |
114 | 144 | </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> |
115 | 182 | "; |
116 | 183 |
|
117 | 184 | } |
|
0 commit comments