11using System ;
2+ using System . Configuration ;
23using System . Windows ;
34using System . Windows . Controls ;
45using System . Windows . Input ;
@@ -22,14 +23,14 @@ public DocumentationLink(DocumentationLinkType type, string url, string label)
2223 public static DocumentationLink WikiLink ( string page , string label )
2324 {
2425 return new DocumentationLink ( DocumentationLinkType . Wiki ,
25- "https://github.com/ButchersBoy/MaterialDesignInXamlToolkit /wiki/" + page , label ) ;
26+ $ " { ConfigurationManager . AppSettings [ "GitHub" ] } /wiki/" + page , label ) ;
2627 }
2728
2829 public static DocumentationLink StyleLink ( string nameChunk )
2930 {
3031 return new DocumentationLink (
3132 DocumentationLinkType . StyleSource ,
32- $ "https://github.com/ButchersBoy/MaterialDesignInXamlToolkit /blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.{ nameChunk } .xaml",
33+ $ "{ ConfigurationManager . AppSettings [ "GitHub" ] } /blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.{ nameChunk } .xaml",
3334 nameChunk ) ;
3435 }
3536
@@ -39,7 +40,7 @@ public static DocumentationLink ApiLink<TClass>(string subNamespace)
3940
4041 return new DocumentationLink (
4142 DocumentationLinkType . ControlSource ,
42- $ "https://github.com/ButchersBoy/MaterialDesignInXamlToolkit /blob/master/MaterialDesignThemes.Wpf/{ subNamespace } /{ typeName } .cs",
43+ $ "{ ConfigurationManager . AppSettings [ "GitHub" ] } /blob/master/MaterialDesignThemes.Wpf/{ subNamespace } /{ typeName } .cs",
4344 typeName ) ;
4445 }
4546
@@ -50,7 +51,7 @@ public static DocumentationLink ApiLink<TClass>()
5051
5152 return new DocumentationLink (
5253 DocumentationLinkType . ControlSource ,
53- $ "https://github.com/ButchersBoy/MaterialDesignInXamlToolkit /blob/master/MaterialDesignThemes.Wpf/{ typeName } .cs",
54+ $ "{ ConfigurationManager . AppSettings [ "GitHub" ] } /blob/master/MaterialDesignThemes.Wpf/{ typeName } .cs",
5455 typeName ) ;
5556 }
5657
@@ -60,14 +61,20 @@ public static DocumentationLink DemoPageLink<TDemoPage>()
6061 }
6162
6263 public static DocumentationLink DemoPageLink < TDemoPage > ( string label )
64+ {
65+ return DemoPageLink < TDemoPage > ( label , null ) ;
66+ }
67+
68+ public static DocumentationLink DemoPageLink < TDemoPage > ( string label , string nameSpace )
6369 {
6470 var ext = typeof ( UserControl ) . IsAssignableFrom ( typeof ( TDemoPage ) )
6571 ? "xaml"
6672 : "cs" ;
6773
74+
6875 return new DocumentationLink (
6976 DocumentationLinkType . DemoPageSource ,
70- $ "https://github.com/ButchersBoy/MaterialDesignInXamlToolkit/ blob/master/MainDemo.Wpf/{ typeof ( TDemoPage ) . Name } .{ ext } ",
77+ $ "{ ConfigurationManager . AppSettings [ "GitHub" ] } / blob/master/MainDemo.Wpf/{ ( string . IsNullOrWhiteSpace ( nameSpace ) ? "" : ( "/" + nameSpace + "/" ) ) } { typeof ( TDemoPage ) . Name } .{ ext } ",
7178 label ?? typeof ( TDemoPage ) . Name ) ;
7279 }
7380
0 commit comments