Пример #1
0
        private async void AddProgressFragment(ProgressFragment item)
        {
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                var fragmentUI = new ProgressBarFragment(item);

                ProgressBarCanvas.Children.Add(fragmentUI);

                CalcProgressBarFragmentPosition(fragmentUI);
            });
        }
Пример #2
0
        private void CalcProgressBarFragmentPosition(ProgressBarFragment fragmentUI, double?width = null)
        {
            if (width == null)
            {
                width = ProgressBarCanvas.ActualWidth;
            }

            fragmentUI.ResetCanvasWidth(width.Value);

            Canvas.SetLeft(fragmentUI,
                           fragmentUI.ProgressFragment
                           .GetStartPositionInCanvas(width.Value)
                           );
        }