コード例 #1
0
ファイル: ImageEx.Source.cs プロジェクト: yunfandev/waslibs
        private void SetImageGif(Uri uri)
        {
            ClearProgress();
            ClearImage();
            ClearImageGif();

            var imageGif = new GifControl();

            imageGif.SetBinding(GifControl.StretchProperty, new Binding {
                Source = this, Path = new PropertyPath("Stretch")
            });
            imageGif.SetBinding(GifControl.HorizontalAlignmentProperty, new Binding {
                Source = this, Path = new PropertyPath("HorizontalAlignment")
            });
            imageGif.SetBinding(GifControl.VerticalAlignmentProperty, new Binding {
                Source = this, Path = new PropertyPath("VerticalAlignment")
            });
            imageGif.SetBinding(GifControl.NineGridProperty, new Binding {
                Source = this, Path = new PropertyPath("NineGrid")
            });
            imageGif.SetBinding(GifControl.AutoPlayProperty, new Binding {
                Source = this, Path = new PropertyPath("AnimateGif")
            });
            imageGif.Source = uri;
            this.Content    = imageGif;
        }
コード例 #2
0
ファイル: ImageEx.Source.cs プロジェクト: ridomin/waslibs
        private void SetImageGif(Uri uri)
        {
            ClearProgress();
            ClearImage();
            ClearImageGif();

            var imageGif = new GifControl();
            imageGif.SetBinding(GifControl.StretchProperty, new Binding { Source = this, Path = new PropertyPath("Stretch") });
            imageGif.SetBinding(GifControl.HorizontalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("HorizontalAlignment") });
            imageGif.SetBinding(GifControl.VerticalAlignmentProperty, new Binding { Source = this, Path = new PropertyPath("VerticalAlignment") });
            imageGif.SetBinding(GifControl.NineGridProperty, new Binding { Source = this, Path = new PropertyPath("NineGrid") });
            imageGif.SetBinding(GifControl.AutoPlayProperty, new Binding { Source = this, Path = new PropertyPath("AnimateGif") });
            imageGif.Source = uri;
            this.Content = imageGif;
        }