Beispiel #1
0
 public BlankPage8()
 {
     this.InitializeComponent();
     MainDispatcher = this.Dispatcher;
     _mainController = new MainController();
     Loaded += BlankPage8_Loaded;
 }
Beispiel #2
0
        public BlankPage6()
        {
            this.InitializeComponent();
            _mainController = new MainController();
            this.DataContext = _mainController.Source;

            Loaded += BlankPage6_Loaded;
        }
Beispiel #3
0
        public BlankPage1()
        {
            this.InitializeComponent();

            mainController = new MainController();
            _source = mainController.Source;
            this.DataContext = _source;

            this.SizeChanged += BlankPage1_SizeChanged;
            Loaded += BlankPage1_Loaded;
        }
        /// <summary>
        /// 初始化
        /// </summary>
        private async void Init()
        {
            _mainController = new MainController();
            await _mainController.Init();
            _images = _mainController.Source.ToList();

            for (int i = 0; i < CanvasContainer.Children.Count; i++)
            {
                var child = CanvasContainer.Children[i];
                child.RenderTransform = new CompositeTransform();
                child.RenderTransformOrigin = new Point(0.5, 0.5);
                (child as FrameworkElement).DataContext = _images[i];
                InitPosition(child);
            }
        }
        /// <summary>
        /// 初始化
        /// </summary>
        private async void Init()
        {
            if (_inited) return;
            _inited = true;

            _mainController = new MainController();
            await _mainController.Init();
            _images = _mainController.Source.ToList();

            var start = _images.IndexOf(_curItem) - 1;
            for (int i = 0; i < CanvasContainer.Children.Count; i++)
            {
                var child = CanvasContainer.Children[i];
                child.RenderTransform = new CompositeTransform();
                child.RenderTransformOrigin = new Point(0.5, 0.5);
                var index = start + i;
                if (index >= 0 && index < _images.Count)
                {
                    (child as FrameworkElement).DataContext = _images[start + i];
                }
                InitPosition(child);
            }
        }