aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml
blob: 92317a5d593f349f56d6672d6946480144b42516 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<UserControl x:Class="Tango.MachineStudio.UI.Views.ResolvedIssuesView"
             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:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete"
             xmlns:integration="clr-namespace:Tango.Integration.ExternalBridge;assembly=Tango.Integration"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels"
             xmlns:tfs="clr-namespace:Tango.TFS;assembly=Tango.TFS"
             xmlns:tfss="clr-namespace:Tango.MachineStudio.UI.TFS"
             xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
             mc:Ignorable="d" Width="530" Height="580" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:ResolvedIssuesViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}">
    <Grid>
        <Grid IsEnabled="{Binding IsAvailable}">
            <Grid.RowDefinitions>
                <RowDefinition Height="130"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="200"/>
            </Grid.RowDefinitions>

            <Grid>
                <StackPanel Margin="10">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Images/bug-resolved.png" Width="48" RenderOptions.BitmapScalingMode="Fant"></Image>
                        <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20">Resolved Issues</TextBlock>
                    </StackPanel>

                    <TextBlock HorizontalAlignment="Left" Margin="10" TextWrapping="Wrap">
                        Below you can find issues reported by you that have been flagged as resolved by the development team.
                        Please verify each one and report back by pressing 'FIXED' or 'NOT FIXED'.
                    </TextBlock>
                </StackPanel>
            </Grid>

            <Grid Grid.Row="1">
                <ListBox x:Name="list" ItemsSource="{Binding TFSClient.ResolvedWorkItems}" HorizontalContentAlignment="Stretch">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Border BorderBrush="{StaticResource WhiteBrush100}" BorderThickness="0 0 0 1" Padding="5">
                                <DockPanel>
                                    <StackPanel DockPanel.Dock="Right" HorizontalAlignment="Right" Orientation="Horizontal">
                                        <Button Background="{StaticResource RedBrush400}" BorderBrush="{StaticResource RedBrush400}" Padding="0" Width="90" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DeclineCommand}" CommandParameter="{Binding}">
                                            <StackPanel Orientation="Horizontal">
                                                <materialDesign:PackIcon VerticalAlignment="Center" Kind="Close" />
                                                <TextBlock Margin="10 0 0 0" FontSize="11" VerticalAlignment="Center">NOT FIXED</TextBlock>
                                            </StackPanel>
                                        </Button>
                                        <Button Background="#91D66D" BorderBrush="#91D66D" Padding="0" Width="90" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ApproveCommand}" CommandParameter="{Binding}">
                                            <StackPanel Orientation="Horizontal">
                                                <materialDesign:PackIcon VerticalAlignment="Center" Kind="Check" />
                                                <TextBlock Margin="10 0 0 0" FontSize="11" VerticalAlignment="Center">FIXED</TextBlock>
                                            </StackPanel>
                                        </Button>
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal" Margin="0 0 10 0" Width="320" HorizontalAlignment="Left">
                                        <Image Source="/Images/bug.png" Width="24" RenderOptions.BitmapScalingMode="Fant"></Image>
                                        <StackPanel Margin="5 0 0 0" ToolTip="{Binding Comment}">
                                            <TextBlock Text="{Binding Title}" FontWeight="SemiBold" TextTrimming="CharacterEllipsis"></TextBlock>
                                            <TextBlock Text="{Binding Comment,TargetNullValue='Comment',FallbackValue='Comment'}" TextWrapping="Wrap" Foreground="{StaticResource GrayBrush}" FontSize="10"></TextBlock>
                                        </StackPanel>
                                    </StackPanel>
                                </DockPanel>
                            </Border>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </Grid>

            <Grid Grid.Row="2">
                <Border BorderBrush="#FFA5A5" BorderThickness="0 1 0 0" Margin="5">
                    <DockPanel>
                        <DockPanel Margin="0 10 0 0" DockPanel.Dock="Top">
                            <materialDesign:PackIcon Kind="ChartTimeline" Width="24" Height="24" VerticalAlignment="Center" Margin="0 0 10 0" />
                            <TextBlock VerticalAlignment="Center" FontSize="16">Steps To Reproduce</TextBlock>
                        </DockPanel>

                        <Grid>
                            <TextBox Margin="5 10 10 10" Style="{x:Null}" BorderThickness="0" AcceptsReturn="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Text="{Binding ElementName=list,Path=SelectedItem.StepsToReproduce}" IsReadOnly="True"></TextBox>
                        </Grid>
                    </DockPanel>
                </Border>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
>/// Gets or sets the module navigation command. /// </summary> public RelayCommand<String> ModuleNavigationCommand { get; set; } /// <summary> /// Gets or sets the menu or back command. /// </summary> public RelayCommand MenuOrBackCommand { get; set; } /// <summary> /// Gets or sets the home command. /// </summary> public RelayCommand HomeCommand { get; set; } /// <summary> /// Gets or sets the notifications area pressed command. /// </summary> public RelayCommand NotificationsAreaPressedCommand { get; set; } /// <summary> /// Initializes a new instance of the <see cref="LayoutViewVM"/> class. /// </summary> public LayoutViewVM() { ModuleNavigationCommand = new RelayCommand<string>(NavigateToModule); HomeCommand = new RelayCommand(NavigateHome); MenuOrBackCommand = new RelayCommand(OpenMenuOrNavigateBack); NotificationsAreaPressedCommand = new RelayCommand(OpenFirstNotificationOrDisplayAll); } /// <summary> /// Opens the menu or navigate back. /// </summary> private void OpenMenuOrNavigateBack() { if (NavigationManager.CanNavigateBack) { NavigationManager.NavigateBack(); } else { IsMenuOpened = true; } } /// <summary> /// Handles the module navigation command. /// </summary> /// <param name="moduleName">Name of the module.</param> private void NavigateToModule(string moduleName) { IsMenuOpened = false; NavigationManager.NavigateTo(moduleName); } /// <summary> /// Handles the home command. /// </summary> private void NavigateHome() { IsMenuOpened = false; NavigationManager.NavigateTo(NavigationView.HomeModule); } /// <summary> /// Called when the application has been started. /// </summary> public override void OnApplicationStarted() { base.OnApplicationStarted(); ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded; } /// <summary> /// Handles the ModulesLoaded event of the ModuleLoader. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void ModuleLoader_ModulesLoaded(object sender, EventArgs e) { View.ApplyModules(ModuleLoader.UserModules); } /// <summary> /// Called when the instance of IPPCView is available. /// </summary> public override void OnViewAttached() { } /// <summary> /// Opens the first notification or display all. /// </summary> private void OpenFirstNotificationOrDisplayAll() { if (NotificationProvider.NotificationItems.Count == 1) { //Open first } else { IsNotificationsOpened = true; } } } }