当前位置: 首页>>代码示例>>C#>>正文


C# DataContextChangedEventArgs类代码示例

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


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


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