zoukankan      html  css  js  c++  java
  • silverlight中使用NavigationContext.QueryString动态加载文章

            private void InitDocument(string _columnname)
            {
                YDZSWebServiceSoapClient client = new YDZSWebServiceSoapClient();
                client.GetServerSidePathByColumCompleted += client_GetServerSidePathByColumCompleted;
                client.GetServerSidePathByColumAsync(_columnname);
            }
    
            void client_GetServerSidePathByColumCompleted(object sender, GetServerSidePathByColumCompletedEventArgs e)
            {
                byte[] stream = e.Result;
                DocxFormatProvider docxProvider = new DocxFormatProvider();
                viewer.RadDocument = docxProvider.Import(stream);
            }
    
    
            // 当用户导航到此页面时执行。
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                Grid parent = App.Current.RootVisual as Grid;
                slApp.MainPage m = parent.Children.First() as slApp.MainPage;
                m.menu.SelectedTitle = "投资指南";
    
                string _columnname;
                //如果带有查询参数,根据参数加载文章
                if (this.NavigationContext.QueryString.ContainsKey("columnName"))
                {
                    _columnname = Convert.ToString(this.NavigationContext.QueryString["columnName"]);
                    InitDocument(_columnname);
                }
            }
    
            private void keysearch_Click(object sender, RoutedEventArgs e)
            {
                Grid parent = App.Current.RootVisual as Grid;
                slApp.MainPage m = parent.Children.First() as slApp.MainPage;
                string uriText = String.Format("GuidePage/ziliao?columnName={0}", txtkey.Text);
                m.ContentFrame.Navigate(new Uri(uriText,UriKind.Relative));
            }
  • 相关阅读:
    13、java中8中基本类型
    12、static final
    11、final详解
    10、java初始化顺序
    9、java中static详解
    9、接口和抽象类
    8、java内部类
    7、手工编译和运行时注意事项
    推荐10 款 SVG 动画的 JavaScript 库
    让优秀的文章脱颖而出---极客头条使用体验
  • 原文地址:https://www.cnblogs.com/xlyg-14/p/4871675.html
Copyright © 2011-2022 走看看