• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DataContextChangedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DataContextChangedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DataContextChangedEventArgs类的具体用法?C# DataContextChangedEventArgs怎么用?C# DataContextChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataContextChangedEventArgs类属于命名空间,在下文中一共展示了DataContextChangedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UserControl_DataContextChanged

        private void UserControl_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
        {
            Graph.ClearSeries();

            var item = DataContext as ChartSong;
            if (item == null) return;

            var color = Colors.White;

            switch (item.ChangeDirection)
            {
                case ChartSong.Direction.Up:
                    color = Colors.Green;
                    break;
                case ChartSong.Direction.Down:
                    color = Colors.Red;
                    break;
            }

            ChangePercentBlock.Foreground = new SolidColorBrush(color);

            var data = item.Signals.Select((p, i) => new Point(i, p)).ToList();

            var serie = new Serie("Signals") {ShiftSize = 100};
            serie.SetData(data);

            Graph.AutoRedraw = true;
            Graph.AddSerie(serie);
        }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:29,代码来源:ChartSongViewer.xaml.cs


示例2: UserControl_DataContextChanged

 private async void UserControl_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     if (args.NewValue != null)
         contentSection.Content = await ContentPreviewConverter.MakePreviewControl(args.NewValue as LinkViewModel, SnooStreamViewModel.UIContextCancellationToken, null, true);
     else
         contentSection.Content = null;
 }
开发者ID:hippiehunter,项目名称:Baconography,代码行数:7,代码来源:CardCommentView.xaml.cs


示例3: MenuControl_DataContextChanged

 private void MenuControl_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     var propertyChanged = PropertyChanged;
     if (propertyChanged != null) {
         propertyChanged(this, new PropertyChangedEventArgs(nameof(ConcreteDataContext)));
     }
 }
开发者ID:ZeusWPI,项目名称:hydra-windows,代码行数:7,代码来源:MenuView.xaml.cs


示例4: UserControl_DataContextChanged

 private void UserControl_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     if (args.NewValue is IPinViewModel)
     {
         (args.NewValue as IPinViewModel).PropertyChanged += ViewModel_PropertyChanged;
     }
 }
开发者ID:ParticleNET,项目名称:Particle-Windows-app,代码行数:7,代码来源:PinControl.xaml.cs


示例5: OnDataContextChanged

 private void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     if (DataContext == null)
         return;
     ViewModel.AnimeItemDisplayContext = DisplayContext;
     Bindings.Update();
 }
开发者ID:Mordonus,项目名称:MALClient,代码行数:7,代码来源:AnimeItem.xaml.cs


示例6: OnDataContextChanged

        private void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
        {

            var m = this.DataContext as MessageRecord;
            if (m != null)
            {
                this.MessageRecord = m;
                VisualStateManager.GoToState(this, m.IsOutgoing ? "Outgoing" : "Incoming", true);


                if (m.IsFailed)
                {
                    VisualStateManager.GoToState(this, "Failed", true);
                }
                else
                {
                    if (!m.IsOutgoing) VisualStateManager.GoToState(this, "None", true);
                    else if (m.IsPending) VisualStateManager.GoToState(this, "Pending", true);
                    else if (m.IsDelivered) VisualStateManager.GoToState(this, "Delivered", true);
                    else VisualStateManager.GoToState(this, "Sent", true);
                }

                if (m.IsKeyExchange)
                {
                    VisualStateManager.GoToState(this, "KeyExchange", true);
                }
            }
        }
开发者ID:smndtrl,项目名称:Signal-UWP,代码行数:28,代码来源:MessageView.xaml.cs


示例7: UserControl_DataContextChanged

 private void UserControl_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     if (args.NewValue != null && args.NewValue is Preview && !string.IsNullOrWhiteSpace(((Preview)args.NewValue).HQThumbnailUrl))
         imageControl.Opacity = 0;
     else
         imageControl.Opacity = 1;
     
 }
开发者ID:hippiehunter,项目名称:Baconography,代码行数:8,代码来源:CardPreviewImageControl.xaml.cs


示例8: WV_DataContextChanged

 private void WV_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     if (args.NewValue != null)
     {
         string content = args.NewValue as string;
         this.WV.NavigateToString(content);
     }
 }
开发者ID:jevonsflash,项目名称:MyRecipe,代码行数:8,代码来源:FoodDetailPage.xaml.cs


示例9: albumSlideView_DataContextChanged

		private async void albumSlideView_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
		{
			var loader = albumSlideView.ItemsSource as ISupportIncrementalLoading;
			if (albumSlideView.Items.Count == 0 && loader != null)
			{
				if (loader.HasMoreItems)
					await loader.LoadMoreItemsAsync(20);
			}
		}
开发者ID:hippiehunter,项目名称:Baconography,代码行数:9,代码来源:AlbumControl.xaml.cs


示例10: OnDataContextChanged

        private void OnDataContextChanged(object sender, DataContextChangedEventArgs e)
        {

            IAmbientColor ambientColor = e.NewValue as IAmbientColor;
            if (ambientColor != null) {
                ambientColor.AmbientColorChanged += (s, ae) => OnAmbientColorChanged(ae);
            }

        }
开发者ID:smndtrl,项目名称:Signal-UWP,代码行数:9,代码来源:SignalPage.cs


示例11: OnDataContextChanged

        private void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
        {
            OnPropertyChanged(nameof(ViewModel));

            var newVm = (EntryListItemViewModel)args.NewValue;

            if (newVm != null)
            {
                newVm.View = this;
            }
        }
开发者ID:pglazkov,项目名称:Linqua,代码行数:11,代码来源:EntryListItemView.xaml.cs


示例12: OnDataContextChanged

        private void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
        {

            var m = this.DataContext as MessageRecord;
            if (m != null)
            {
                this.MessageRecord = m;
                Update();

            }
        }
开发者ID:smndtrl,项目名称:Signal-UWP,代码行数:11,代码来源:AlertView.xaml.cs


示例13: OnDataContextChanged

 private void OnDataContextChanged(FrameworkElement s, DataContextChangedEventArgs e) {
     if (ViewModel != null)
         ViewModel.PropertyChanged -= ViewModelOnPropertyChanged;
     ViewModel = DataContext as PostViewModel;
     if (ViewModel != null) {
         if (ViewModel.ShortenText)
             this.PostText.MaxLines = SettingsService.MaxLinesInBoard;
         ViewModel.PropertyChanged += ViewModelOnPropertyChanged;
         IsRepliesButtonVisible = ViewModel.AreRepliesVisible && ShowRepliesAsRibbon;
         AreRepliesVisible = ViewModel.AreRepliesVisible && !ShowRepliesAsRibbon;
     }
 }
开发者ID:acedened,项目名称:TheChan,代码行数:12,代码来源:PostView.xaml.cs


示例14: MonsterListView_DataContextChanged

 private void MonsterListView_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     try
     {
         if (this.DataContext != null)
             MonsterGridView.DataContext = new ObservableCollection<Monster>(this.DataContext as List<Monster>);
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
     }
 }
开发者ID:NestedWorld,项目名称:Windows10,代码行数:12,代码来源:MonsterListView.xaml.cs


示例15: lpProtocolItem_DataContextChanged

        private void lpProtocolItem_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
        {
            var cbi = lpProtocol.ContainerFromItem(args.NewValue) as ComboBoxItem;
            if (cbi != null)
            {
                var val = (LocomotiveProtocolType) args.NewValue;
                var isDisabled = val == LocomotiveProtocolType.M4 || val == LocomotiveProtocolType.MULTI;

                cbi.IsHitTestVisible = !isDisabled;
                cbi.Foreground = (Brush)(isDisabled ? Resources["SystemControlDisabledBaseLowBrush"] : Resources["SystemControlForegroundChromeWhiteBrush"]);
            }
        }
开发者ID:KonstantinKolesnik,项目名称:EcosHub,代码行数:12,代码来源:ucLocomotiveEditor.xaml.cs


示例16: MonsterInformationView_DataContextChanged

 private void MonsterInformationView_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     if (DataContext == null)
     {
         this.Visibility = Visibility.Collapsed;
     }
     else
     {
         this.Visibility = Visibility.Visible;
         hearderView.DataContext = this.DataContext;
     }
 }
开发者ID:NestedWorld,项目名称:Windows10,代码行数:12,代码来源:MonsterInformationView.xaml.cs


示例17: GoMissAttendanceInfo_DataContextChanged

        private void GoMissAttendanceInfo_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
        {
            if (this.DataContext == null)
                return;

            Attendance a = this.DataContext as Attendance;
            Percentage = (int)a.Percentage;

            GoPercentage = (int)Math.Ceiling((double)(a.AttendedClasses + a.SingleClassLength) * 100.00 / (a.TotalClasses + a.SingleClassLength));
            MissPercentage = (int)Math.Ceiling((double)a.AttendedClasses * 100.00 / (a.TotalClasses + a.SingleClassLength));

            infoGrid.DataContext = this;
        }
开发者ID:gitter-badger,项目名称:VITacademics_Windows,代码行数:13,代码来源:GoMissAttendanceInfo.xaml.cs


示例18: AbilityView_DataContextChanged

        void AbilityView_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
        {
            if (DataContext == null)
                return;

            var ability = DataContext as Ability;
            if (ability == null)
                return;

            PlaceholderTextConverter.ConvertTextWithPlaceholders(txtEffect, ability.Description);
            PlaceholderTextConverter.ConvertTextWithPlaceholders(txtEffectChange, ability.VersionChangelog);
            PlaceholderTextConverter.ConvertTextWithPlaceholders(txtShortEffect, ability.ShortDescription);
        }
开发者ID:Kampfmoehre,项目名称:PokeGuide,代码行数:13,代码来源:AbilityView.xaml.cs


示例19: OnDataContextChanged

 private void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
 {
     var widget = (args.NewValue as Widget);
     if (widget != null && widget.IsChartWidget())
     {
         var setup = _database.GetSetup();
         Url1 = string.Format(urlFormat, setup.Url, widget.Label, widget.Period, _random.Next(int.MinValue, int.MaxValue));
         if (!setup.RemoteUrl.IsNullOrEmpty())
         {
             Url2 = string.Format(urlFormat, setup.RemoteUrl, widget.Label, widget.Period, _random.Next(int.MinValue, int.MaxValue));
         }
         this.theImage.Source = new BitmapImage(new Uri(Url1));
     }
 }
开发者ID:altima,项目名称:openhabUWP,代码行数:14,代码来源:ChartWidget.xaml.cs


示例20: OnDataContextChanged

        private void OnDataContextChanged(FrameworkElement s, DataContextChangedEventArgs e) {
            if (ViewModel != null) {
                ViewModel.CaptchaEntryRequested -= ViewModelOnCaptchaEntryRequested;
            }

            ViewModel = DataContext as ExtendedPostingViewModel;
            if (ViewModel == null)
                return;

            this.Title.Text = Localization.GetForView("ExtendedPosting",
                ViewModel.IsNewThread
                    ? "ThreadCreationTitle.Text"
                    : "PostCreationTitle.Text");

            ViewModel.CaptchaEntryRequested += ViewModelOnCaptchaEntryRequested;
        }
开发者ID:acedened,项目名称:TheChan,代码行数:16,代码来源:ExtendedPostingView.xaml.cs



注:本文中的DataContextChangedEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataContract类代码示例发布时间:2022-05-24
下一篇:
C# DataContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap