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));
            }
  • 相关阅读:
    regedit注册表
    Environment应用
    VMI帮助类
    Image帮助类
    asp.net core+Postman
    printf和cout的区别详述
    C++指针
    Qt button和buttons区别
    visual studio收函数
    编译警告
  • 原文地址:https://www.cnblogs.com/xlyg-14/p/4871675.html
Copyright © 2011-2022 走看看