Exemplo n.º 1
0
        private void Generate()
        {
            Task.Run(() =>
            {
                var success = StereogramWrapper.Generate();

                SetResult(success);
            });
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            _updateTextureProperties = new[]
            {
                nameof(StereogramWrapper.Texture),
                nameof(StereogramWrapper.TextureWidth),
                nameof(StereogramWrapper.MaxSeparation),
                nameof(StereogramWrapper.MinSeparation),
            };

            StereogramWrapper = new StereogramWrapper();
            LayersData        = new Layers();

            InitializeComponent();

            StereogramWrapper.PropertyChanged += Stereogram_PropertyChanged;
            DataContext = StereogramWrapper;

            LayersListView.DataContext = LayersData;

            _image = new Image {
                Name = StereogramLayerName
            };
            MainCanvas.Children.Add(_image);
            LayersData.Add(new Layer {
                Name = StereogramLayerName, Element = _image
            });

            // We need these layers to be built as well
            SetIndicators();
            SetCopyrightMessage();

            var paddingZoomValue = ZoomValueLabel.Padding;

            paddingZoomValue.Right = 0;
            ZoomValueLabel.Padding = paddingZoomValue;
            var paddingZoomValuePercentage = ZoomValuePercentageLabel.Padding;

            paddingZoomValuePercentage.Left  = 0;
            ZoomValuePercentageLabel.Padding = paddingZoomValuePercentage;

            UpdateValidationMessages();
        }