/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/Core/Def/ValueTracking/ValueTrackingTree.xaml
126 строк
7 KB
Sandy Armstrong
Always specify Image width/height for glyphs sourced from IGlyphService
26 янв 2025, 19:19
26 янв 2025, 19:19
096de0c
Код
Авторство
О чём код?
<UserControl x:Class="Microsoft.VisualStudio.LanguageServices.ValueTracking.ValueTrackingTree" x:ClassModifier="internal" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Microsoft.VisualStudio.LanguageServices.ValueTracking" xmlns:utils="clr-namespace:Microsoft.VisualStudio.LanguageServices.Utilities" xmlns:platformimaging="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging" xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0" xmlns:vsutil="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities" mc:Ignorable="d" xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0" platformimaging:ImageThemingUtilities.ImageBackgroundColor="{StaticResource {x:Static vsshell:VsColors.ToolWindowBackgroundKey}}" d:DesignHeight="450" d:DesignWidth="800" x:Name="control"> <UserControl.Resources> <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> <platformimaging:ThemedImageSourceConverter x:Uid="ThemedImageSourceConverter" x:Key="ThemedImageSourceConverter" /> </UserControl.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions> <ProgressBar Grid.Row="0" Grid.ColumnSpan="3" Grid.Column="0" IsIndeterminate="{Binding RelativeSource={RelativeSource Self}, Path=IsVisible}" Panel.ZIndex="10000" Minimum="0" Maximum="100" Height="2" Visibility="{Binding IsLoading, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}" Foreground="{DynamicResource {x:Static vs:ProgressBarColors.IndicatorFillBrushKey}}" Background="{DynamicResource {x:Static vs:ProgressBarColors.BackgroundBrushKey}}" /> <TreeView Grid.Row="1" Grid.Column="0" x:Name="ValueTrackingTreeView" ItemsSource="{Binding Roots}" SelectedItemChanged="ValueTrackingTree_SelectedItemChanged" BorderThickness="0" PreviewKeyDown="ValueTrackingTree_PreviewKeyDown" PreviewMouseDoubleClick="ValueTrackingTree_MouseDoubleClickPreview" AutomationProperties.Name="{Binding AutomationName, Mode=OneWay}"> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="{Binding IsNodeExpanded, Mode=TwoWay}" /> <Setter Property="IsSelected" Value="{Binding IsNodeSelected, Mode=TwoWay}" /> <Setter Property="AutomationProperties.Name" Value="{Binding AutomationName, Mode=OneWay}" /> </Style> </TreeView.ItemContainerStyle> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type local:TreeItemViewModel}" ItemsSource="{Binding ChildItems}"> <StackPanel Orientation="Horizontal"> <Image Width="16" Height="16"> <Image.Source> <MultiBinding x:Uid="MultiBinding_1" Converter="{StaticResource ThemedImageSourceConverter}"> <Binding x:Uid="Binding_1" Path="GlyphImage" /> <Binding x:Uid="Binding_2" Path="(platformimaging:ImageThemingUtilities.ImageBackgroundColor)" RelativeSource="{RelativeSource Self}" /> <Binding x:Uid="Binding_3" Source="{x:Static vsutil:Boxes.BooleanTrue}" /> </MultiBinding> </Image.Source> </Image> <utils:BindableTextBlock InlineCollection="{Binding Inlines}" Margin="0 0 5 0" /> </StackPanel> </HierarchicalDataTemplate> <DataTemplate DataType="{x:Type local:EmptyTreeViewItem}"> </DataTemplate> <DataTemplate DataType="{x:Type local:ComputingTreeViewItem}"> <StackPanel Orientation="Horizontal"> <vs:ProgressControl Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center"> <vs:ProgressControl.RenderTransform> <ScaleTransform ScaleX="0.50" ScaleY="0.50" /> </vs:ProgressControl.RenderTransform> </vs:ProgressControl> <TextBlock Text="{Binding Text}" Margin="0 0 5 0" /> </StackPanel> </DataTemplate> </TreeView.Resources> </TreeView> <GridSplitter Grid.Column="1" Grid.Row="1" ResizeBehavior="PreviousAndNext" ShowsPreview="true" Width="5" /> <ScrollViewer Grid.Column="2" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" HorizontalContentAlignment="Left" HorizontalAlignment="Left"> <Grid Visibility="{Binding ShowDetails, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Label Content="File" Grid.Row="0" Grid.Column="0" x:Name="FileNameLabel" /> <Label Grid.Row="0" Grid.Column="1" Content="{Binding SelectedItemFile}" x:Name="FileName" AutomationProperties.LabeledBy="{Binding ElementName=FileNameLabel}" VerticalAlignment="Center" /> <Label Content="Line" Grid.Row="1" Grid.Column="0" x:Name="LineNumberLabel" /> <Label Grid.Row="1" Grid.Column="1" Content="{Binding SelectedItemLine}" x:Name="LineNumber" AutomationProperties.LabeledBy="{Binding ElementName=LineNumberLabel}" VerticalAlignment="Center" /> </Grid> </ScrollViewer> </Grid> </UserControl>