当前位置: 首页>>代码示例>>C#>>正文


C# ProgressBar.SetBinding方法代码示例

本文整理汇总了C#中System.Windows.Controls.ProgressBar.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar.SetBinding方法的具体用法?C# ProgressBar.SetBinding怎么用?C# ProgressBar.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.SetBinding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: App

        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;
            }

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            ProgressBar pb = new ProgressBar();
            pb.Height = 20;

            RootFrame.HeaderContent = pb;

            Binding pbBinding = new Binding("IsLoading");
            pbBinding.Source = DataManager.Current;
            pb.SetBinding(ProgressBar.IsIndeterminateProperty, pbBinding);

            DataManager.ShouldCollectStatistics = true;
        }
开发者ID:rmarinho,项目名称:AgFx,代码行数:39,代码来源:App.xaml.cs

示例2: HandleDoubleClick


//.........这里部分代码省略.........
            urGridView.Columns.Add(gvc2);

            GridViewColumn gvc3 = new GridViewColumn();
            GridViewColumnHeader gvc3H = new GridViewColumnHeader();

            gvc3H.FontSize = 11;
            gvc3H.Width = 120;
            gvc3H.Content = " Progress";
            gvc3H.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left;
            gvc3.DisplayMemberBinding = new Binding("UserProgressMsg");
            gvc3.Header = gvc3H;
            urGridView.Columns.Add(gvc3);

            urListView[accountnum].View = urGridView;

            urGrid.Children.Add(urListView[accountnum]);
            //

            // now create Listbox for errors
            lbErrors[accountnum] = new ListBox();
            lbErrors[accountnum].FontSize = 11;
            lbErrors[accountnum].SetValue(Grid.RowProperty, 1);
            lbErrors[accountnum].Margin = new Thickness(5, 5, 5, 5);
            lbErrors[accountnum].MinHeight = 120;
            lbErrors[accountnum].MaxHeight = 120;
            lbErrors[accountnum].MinWidth = 450;
            lbErrors[accountnum].HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            lbErrors[accountnum].VerticalAlignment = System.Windows.VerticalAlignment.Top;
            urGrid.Children.Add(lbErrors[accountnum]);
            //

            // Now set up the progressbar and message status in another grid
            userProgressBar = new ProgressBar();
            userProgressBar.SetValue(Grid.RowProperty, 2);
            userProgressBar.SetValue(Grid.ColumnProperty, 0);
            userProgressBar.SetValue(Grid.ColumnSpanProperty, 2);
            userProgressBar.IsIndeterminate = false;
            userProgressBar.Orientation = Orientation.Horizontal;
            userProgressBar.Width = 412;
            userProgressBar.Height = 18;
            userProgressBar.Margin = new Thickness(36, 0, 0, 0);
            userProgressBar.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            // FBS bug 74960 -- 6/1/12
            ToolTip tooltip = new ToolTip();
            Binding tbBinding = new Binding("GlobalAcctProgressMsg");
            tbBinding.Source = ar;
            tooltip.SetBinding(ContentControl.ContentProperty, tbBinding);
            ToolTipService.SetToolTip(userProgressBar, tooltip);

            // Change the background and foreground colors
            SolidColorBrush scbBack = new SolidColorBrush();
            scbBack.Color = Color.FromArgb(255, 218, 227, 235);   // #FFDAE3EB
            userProgressBar.Background = scbBack;
            userProgressBar.Foreground = Brushes.DodgerBlue;
            ///

            Binding upbBinding = new Binding("PBValue");
            upbBinding.Source = ar;
            userProgressBar.SetBinding(ProgressBar.ValueProperty, upbBinding);
            if (!ViewModel.GetScheduleViewModel().IsPreviewMode())
            {
                urGrid.Children.Add(userProgressBar);
            }

            userStatusMsg = new Label();
            userStatusMsg.Visibility = System.Windows.Visibility.Visible;
            userStatusMsg.SetValue(Grid.RowProperty, 3);
            userStatusMsg.SetValue(Grid.ColumnProperty, 0);
            userStatusMsg.SetValue(Grid.ColumnSpanProperty, 2);
            userStatusMsg.MinWidth = 300;
            userStatusMsg.Margin = new Thickness(30, 0, 0, 0);
            userStatusMsg.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            userStatusMsg.FontStyle = FontStyles.Italic;
            Binding usmBinding = new Binding("PBMsgValue");
            usmBinding.Source = ar;
            userStatusMsg.SetBinding(Label.ContentProperty, usmBinding);
            urGrid.Children.Add(userStatusMsg);
            //////////////

            userItem.Content = urGrid;

            tabCtrl.Items.Add(userItem);
            userItem.IsSelected = true;

            Binding binding = new Binding();

            // wrap in NotifyCollectionChangedWrapper so we can update collection from a different thread
            binding.Source = new NotifyCollectionChangedWrapper<UserResultsViewModel>(ar.UserResultsList);
            //

            BindingOperations.SetBinding(urListView[accountnum], ListView.ItemsSourceProperty,
                binding);
            }
            catch (Exception excep)
            {
            Log.err("error when get usermigration information " + excep.Message);

            }
        }
开发者ID:Ppalanivelu,项目名称:zimbra-sources,代码行数:101,代码来源:ResultsView.xaml.cs


注:本文中的System.Windows.Controls.ProgressBar.SetBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。