• 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));
            }
  • 相关阅读:
    Select列表操作函数
    IBM职业之路—职业规划和技术发展(转自LU)听听前辈的意见
    C#上传下载文件ftp操作类FTPClient代码(转)
    C# FTP操作类
    UML基础
    DevExpress控件之XtraTreeList
    认识UML类图元素
    C#读写EXCEL
    C#正则表达式整理备忘
    面向对象程序可视化类图的逆向自动生成
  • 原文地址:https://www.cnblogs.com/xlyg-14/p/4871675.html
Copyright © 2020-2023  润新知