• 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));
            }
  • 相关阅读:
    oracle用户被锁
    Docker入门
    物化视图
    MySQL报错:Packets larger than max_allowed_packet are not all
    ORA-01555 快照过旧
    mysql授予权限
    CentOS7.4安装部署KVM虚拟机
    前端面试题收藏
    CoffeeScript 学习笔记
    spring学习笔记(四)
  • 原文地址:https://www.cnblogs.com/xlyg-14/p/4871675.html
Copyright © 2020-2023  润新知