Interaction logic for ProgressControl.xaml
Inheritance: System.Windows.Controls.Grid, IProgressVisualizer
Example #1
0
        private static ProgressControl VisualizeInHost(IProgressControlHost host)
        {
            Debug.Assert(ThreadHelper.CheckAccess(), "Expected to be called on the UI thread");
            var progressControl = new ProgressControl();

            host.Host(progressControl);
            return(progressControl);
        }
Example #2
0
        /// <summary>
        /// Will use the specified <paramref name="host"/> to visualize the progress of <paramref name="controller"/>
        /// </summary>
        public static ProgressObserver Observe(IProgressController controller, IProgressControlHost host)
        {
            if (controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }

            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }

            Debug.Assert(ThreadHelper.CheckAccess(), "Expected to be called on the UI thread");

            ProgressControl visualizer = VisualizeInHost(host);

            return(Observe(controller, visualizer));
        }
 protected virtual void HostProgressControl(ProgressControl control)
 {
     this.progressPlacePlaceholder.Content = control;
 }
 void IProgressControlHost.Host(ProgressControl progressControl)
 {
     this.HostProgressControl(progressControl);
 }
 private static ProgressControl VisualizeInHost(IProgressControlHost host)
 {
     Debug.Assert(ThreadHelper.CheckAccess(), "Expected to be called on the UI thread");
     var progressControl = new ProgressControl();
     host.Host(progressControl);
     return progressControl;
 }
 void IProgressControlHost.Host(ProgressControl progressControl)
 {
     Assert.IsNotNull(progressControl);
     this.progressControl = progressControl;
 }