Skip to content

Commit b2dec34

Browse files
authored
Fixed GitHub links (#2777)
* Update GitHub links * Avoid opening cmd window when opening links This method works on all current target frameworks * Fixed MD3 style links * Fixed MD3 demo links
1 parent 2730a13 commit b2dec34

File tree

9 files changed

+20
-25
lines changed

9 files changed

+20
-25
lines changed

MainDemo.Wpf/App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
55
</startup>
66
<appSettings>
7-
<add key="GitHub" value="https://github.com/ButchersBoy/MaterialDesignInXamlToolkit"/>
7+
<add key="GitHub" value="https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/"/>
88
</appSettings>
99
</configuration>

MainDemo.Wpf/Domain/Link.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ public static class Link
77
{
88
public static void OpenInBrowser(string? url)
99
{
10-
if (url is null) return;
11-
//https://github.com/dotnet/corefx/issues/10361
12-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
10+
if (url is not null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
1311
{
14-
url = url.Replace("&", "^&");
15-
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
12+
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
1613
}
1714
}
1815
}

MaterialDesign3.Demo.Wpf/App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
55
</startup>
66
<appSettings>
7-
<add key="GitHub" value="https://github.com/ButchersBoy/MaterialDesignInXamlToolkit"/>
7+
<add key="GitHub" value="https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit"/>
88
</appSettings>
99
</configuration>

MaterialDesign3.Demo.Wpf/Domain/DocumentationLink.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ public static DocumentationLink WikiLink(string page, string label)
2626
$"{ConfigurationManager.AppSettings["GitHub"]}/wiki/" + page, label);
2727
}
2828

29-
public static DocumentationLink StyleLink(string nameChunk)
29+
public static DocumentationLink StyleLink(string nameChunk, bool isMd3Style = false)
3030
{
31+
var themesUrl = $"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/Themes/";
32+
3133
return new DocumentationLink(
3234
DocumentationLinkType.StyleSource,
33-
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.{nameChunk}.xaml",
35+
$"{themesUrl}MaterialDesign{(isMd3Style ? "3" : "Theme")}.{nameChunk}.xaml",
3436
nameChunk);
3537
}
3638

@@ -73,7 +75,7 @@ public static DocumentationLink DemoPageLink<TDemoPage>(string? label, string? @
7375

7476
return new DocumentationLink(
7577
DocumentationLinkType.DemoPageSource,
76-
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MainDemo.Wpf/{(string.IsNullOrWhiteSpace(@namespace) ? "" : "/" + @namespace + "/")}{typeof(TDemoPage).Name}.{ext}",
78+
$"{ConfigurationManager.AppSettings["GitHub"]}/blob/master/MaterialDesign3.Demo.Wpf/{(string.IsNullOrWhiteSpace(@namespace) ? "" : "/" + @namespace + "/")}{typeof(TDemoPage).Name}.{ext}",
7779
label ?? typeof(TDemoPage).Name);
7880
}
7981

MaterialDesign3.Demo.Wpf/Domain/Link.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ public static class Link
77
{
88
public static void OpenInBrowser(string? url)
99
{
10-
if (url is null) return;
11-
//https://github.com/dotnet/corefx/issues/10361
12-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
10+
if (url is not null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
1311
{
14-
url = url.Replace("&", "^&");
15-
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
12+
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
1613
}
1714
}
1815
}

MaterialDesign3.Demo.Wpf/Domain/MainWindowViewModel.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,8 @@ private static IEnumerable<DemoItem> GenerateDemoItems(ISnackbarMessageQueue sna
188188
new[]
189189
{
190190
DocumentationLink.DemoPageLink<Toggles>(),
191-
DocumentationLink.StyleLink("ToggleButton"),
192-
DocumentationLink.StyleLink("CheckBox"),
193-
DocumentationLink.ApiLink<Toggles>()
191+
DocumentationLink.StyleLink("ToggleButton", true),
192+
DocumentationLink.StyleLink("CheckBox")
194193
},
195194
selectedIcon: PackIconKind.ToggleSwitch,
196195
unselectedIcon: PackIconKind.ToggleSwitchOffOutline);
@@ -281,7 +280,7 @@ private static IEnumerable<DemoItem> GenerateDemoItems(ISnackbarMessageQueue sna
281280
new[]
282281
{
283282
DocumentationLink.DemoPageLink<Typography>(),
284-
DocumentationLink.StyleLink("TextBlock")
283+
DocumentationLink.StyleLink("TextBlock", true)
285284
},
286285
selectedIcon: PackIconKind.FormatSize,
287286
unselectedIcon: PackIconKind.FormatTitle)
@@ -416,7 +415,7 @@ private static IEnumerable<DemoItem> GenerateDemoItems(ISnackbarMessageQueue sna
416415
new[]
417416
{
418417
DocumentationLink.DemoPageLink<NavigationRail>(),
419-
DocumentationLink.StyleLink("NavigationRail"),
418+
DocumentationLink.StyleLink("NavigationRail", true),
420419
},
421420
selectedIcon: PackIconKind.NavigationVariant,
422421
unselectedIcon: PackIconKind.NavigationVariantOutline)
@@ -430,7 +429,7 @@ private static IEnumerable<DemoItem> GenerateDemoItems(ISnackbarMessageQueue sna
430429
new[]
431430
{
432431
DocumentationLink.DemoPageLink<NavigationBar>(),
433-
DocumentationLink.StyleLink("NavigationBar"),
432+
DocumentationLink.StyleLink("NavigationBar", true),
434433
},
435434
selectedIcon: PackIconKind.NavigationVariant,
436435
unselectedIcon: PackIconKind.NavigationVariantOutline)

MaterialDesignThemes.Wpf/Transitions/TransitioningContentBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected virtual void RunOpeningEffects()
126126

127127
private FrameworkElement GetNameScopeRoot()
128128
{
129-
//https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/issues/950
129+
//https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/950
130130
//Only set the NameScope if the child does not already have a TemplateNameScope set
131131
if (VisualChildrenCount > 0 && GetVisualChild(0) is FrameworkElement fe && NameScope.GetNameScope(fe) != null)
132132
{

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Comprehensive and easy to use Material Design theme and control library for the
3030

3131
# ![Alt text](web/images/MD4XAML28.png "In Action") See It In Action
3232

33-
- Download a pre-compiled demo from the [releases](https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/releases) page.
33+
- Download a pre-compiled demo from the [releases](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/releases) page.
3434
- Download the source and run the demo ([more information](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/wiki/Compiling-From-Source)).
3535
- Checkout [Keboo/MaterialDesign.Examples](https://github.com/Keboo/MaterialDesignInXaml.Examples)
3636
- Checkout [doobry](http://materialdesigninxaml.net/doobry).
@@ -63,7 +63,7 @@ To load the source project you will need Visual Studio 2022. Don't worry if you
6363
- [ControlzEx](https://github.com/ControlzEx/ControlzEx) - Library used in MaterialDesignInXAML
6464
- [Ignace Maes](https://github.com/IgnaceMaes) - Whose [Material Skin](https://github.com/IgnaceMaes/MaterialSkin) project inspired the original material design theme for [Dragablz](https://github.com/ButchersBoy/Dragablz), which in turn led James Willock start this project
6565
- [Material Design Extensions](https://github.com/spiegelp/MaterialDesignExtensions) - A community repository based on this library that provides additional controls and features.
66-
- **[Contributors](https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/graphs/contributors)** - A big thank you to all the contributors of the project!
66+
- **[Contributors](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/graphs/contributors)** - A big thank you to all the contributors of the project!
6767

6868
# <a name="Screenshots"></a>![Alt text](web/images/MD4XAML28.png "Screenshots") Screenshots
6969

web/PaletteBuilder.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body>
99
<div id="header">
1010
<h1>Material Design in XAML Toolkit Palette Builder</h1>
11-
<p>This isn't a web demo/style resource for Material Design, but is a tool for building a Material Design palette and ResourceDictionary for XAML applications using the <a href="https://github.com/ButchersBoy/MaterialDesignInXamlToolkit">Material Design in XAML Toolkit</a>.</p>
11+
<p>This isn't a web demo/style resource for Material Design, but is a tool for building a Material Design palette and ResourceDictionary for XAML applications using the <a href="https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit">Material Design in XAML Toolkit</a>.</p>
1212
</div>
1313
<div id="huesContainer">
1414
<div>

0 commit comments

Comments
 (0)