NavigateButton.cs CampusAppWP8::Utility::Lui::Button::NavigateButton CampusAppWP8::Utility::Lui::Button //----------------------------------------------------------------------- //<copyrightfile="NavigateButton.cs"company="BTU/IIT"> //Companycopyrighttag. //</copyright> //<author>stubbfel</author> //<sience>08.07.2013</sience> //---------------------------------------------------------------------- namespaceCampusAppWP8.Utility.Lui.Button { usingSystem; usingSystem.Windows; usingSystem.Windows.Controls; publicclassNavigateButton:System.Windows.Controls.Button { #regionMembers publicstaticreadonlyDependencyPropertyNavigateProperty=DependencyProperty.Register("Url",typeof(object),typeof(NavigateButton),newPropertyMetadata(false)); publicstaticreadonlyDependencyPropertyQueryValueProperty=DependencyProperty.Register("QuerryStringValue",typeof(object),typeof(NavigateButton),newPropertyMetadata(false)); publicstaticreadonlyDependencyPropertyQueryNameProperty=DependencyProperty.Register("QuerryStringName",typeof(object),typeof(NavigateButton),newPropertyMetadata(false)); #endregion #regionConstructors publicNavigateButton() :base() { } #endregion #regionProberties publicobjectUrl { get{return(object)this.GetValue(NavigateProperty);} set{this.SetValue(NavigateProperty,value);} } publicobjectQuerryStringName { get{return(object)this.GetValue(QueryNameProperty);} set{this.SetValue(QueryNameProperty,value);} } publicobjectQuerryStringValue { get{return(object)this.GetValue(QueryValueProperty);} set{this.SetValue(QueryValueProperty,value);} } #endregion #regionMethods protectedoverridevoidOnClick() { stringurlString=this.Urlasstring; if(this.QuerryStringName!=null&&this.QuerryStringValue!=null) { urlString+="?"+this.QuerryStringName+"="+this.QuerryStringValue; } Uriurl=newUri(urlStringasstring,UriKind.Relative); Pagepage=App.RootFrame.ContentasPage; page.NavigationService.Navigate(url); } #endregion } }