コード例 #1
0
ファイル: AcrylicBrush.cs プロジェクト: zl0730/FluentWPF
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            var pvt    = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget;
            var target = pvt.TargetObject as FrameworkElement;

            var acrylicPanel = new AcrylicPanel()
            {
                TintColor    = this.TintColor,
                TintOpacity  = this.TintOpacity,
                NoiseOpacity = this.NoiseOpacity,
                Width        = target.Width,
                Height       = target.Height
            };

            BindingOperations.SetBinding(acrylicPanel, AcrylicPanel.TargetProperty, new Binding()
            {
                ElementName = this.TargetName
            });
            BindingOperations.SetBinding(acrylicPanel, AcrylicPanel.SourceProperty, new Binding()
            {
                Source = target
            });

            var brush = new VisualBrush(acrylicPanel)
            {
                Stretch      = Stretch.None,
                AlignmentX   = AlignmentX.Left,
                AlignmentY   = AlignmentY.Top,
                ViewboxUnits = BrushMappingMode.Absolute,
            };

            return(brush);
        }
コード例 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 13 "..\..\MainWindow.xaml"
                ((XClock.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 13 "..\..\MainWindow.xaml"
                ((XClock.MainWindow)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.TitleBar_MouseMove);

            #line default
            #line hidden
                return;

            case 2:
                this.Text_Title = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:

            #line 51 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Mini);

            #line default
            #line hidden
                return;

            case 4:
                this.Main = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.TimeLable = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.DayLable = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.weathercard = ((MaterialDesignThemes.Wpf.Card)(target));
                return;

            case 8:
                this.weathercardwindow = ((SourceChord.FluentWPF.AcrylicPanel)(target));
                return;

            case 9:
                this.day = ((System.Windows.Controls.Image)(target));
                return;

            case 10:
                this.night = ((System.Windows.Controls.Image)(target));
                return;

            case 11:
                this._1h = ((System.Windows.Controls.Image)(target));
                return;

            case 12:
                this.high = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.low = ((System.Windows.Controls.Label)(target));
                return;

            case 14:
                this._1hc = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }