diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
6 files changed, 59 insertions, 7 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index c61e58fd8..c9bba3ad8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("4.0.3.0")] +[assembly: AssemblyVersion("4.0.5.0")] [assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index c13c7379a..573e56fff 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -362,7 +362,6 @@ namespace Tango.MachineStudio.UI.ViewModels { AccessToken = _authenticationProvider.AccessToken, Version = _applicationManager.Version.ToString(), - AcceptBetaRelease = _settings.AcceptBetaRelease, }).Result; IsUpdateAvailable = response.IsUpdateAvailable; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs index 21330a4fc..6df5fc4bc 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs @@ -47,7 +47,7 @@ namespace Tango.MachineStudio.UI.ViewModels Project = project; WorkItem = workItem; - var area = project.Areas.FirstOrDefault(x => x.Name == _settings.DefaultIssueReportArea); + var area = project.GetAreaByName(_settings.DefaultIssueReportArea); if (area != null) { workItem.Area = area; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs index f671251f7..63cff2242 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs @@ -221,7 +221,6 @@ namespace Tango.MachineStudio.UI.ViewModels { AccessToken = _authentication.AccessToken, Version = _application.Version.ToString(), - AcceptBetaRelease = settings.AcceptBetaRelease, }).Result; if (response.IsUpdateAvailable) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml index 7387c4ae5..5f5e1042b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml @@ -35,7 +35,7 @@ </StackPanel> </Grid> - <Grid Grid.Row="1"> + <Grid Grid.Row="1" Focusable="True"> <DockPanel> <StackPanel DockPanel.Dock="Top"> <DockPanel> @@ -50,7 +50,28 @@ <DockPanel Margin="0 10 0 0"> <materialDesign:PackIcon Kind="Star" Width="24" Height="24" VerticalAlignment="Center" Margin="0 0 10 0" /> - <ComboBox materialDesign:HintAssist.Hint="Area" materialDesign:HintAssist.IsFloating="True" ItemsSource="{Binding Project.Areas}" SelectedItem="{Binding WorkItem.Area}" DisplayMemberPath="Name"></ComboBox> + <Grid> + <TextBox IsReadOnly="True" materialDesign:HintAssist.Hint="Area" materialDesign:HintAssist.IsFloating="True" Text="{Binding WorkItem.Area.Name}" VerticalAlignment="Bottom" Margin="0 0 0 3"></TextBox> + <ToggleButton x:Name="toggleArea"> + <ToggleButton.Template> + <ControlTemplate TargetType="ToggleButton"> + <Grid Background="Transparent"> + <Popup Height="200" AllowsTransparency="True" Width="{TemplateBinding ActualWidth}" PopupAnimation="Slide" IsOpen="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"> + <Border Background="White" Margin="0 2 0 0" BorderBrush="Silver" BorderThickness="1" CornerRadius="3"> + <TreeView Loaded="TreeView_Loaded" ItemsSource="{Binding Project.Areas}" SelectedItemChanged="TreeView_SelectedItemChanged"> + <TreeView.ItemTemplate> + <HierarchicalDataTemplate ItemsSource="{Binding SubAreas}"> + <TextBlock Text="{Binding Name}" /> + </HierarchicalDataTemplate> + </TreeView.ItemTemplate> + </TreeView> + </Border> + </Popup> + </Grid> + </ControlTemplate> + </ToggleButton.Template> + </ToggleButton> + </Grid> </DockPanel> <DockPanel Margin="0 10 0 0"> @@ -101,7 +122,7 @@ <TextBox IsReadOnly="True" Text="{Binding ImageFile}"></TextBox> </DockPanel> </StackPanel> - + <Grid> <DockPanel> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs index 72bef1205..e17ed7d93 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs @@ -12,6 +12,8 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.MachineStudio.UI.ViewModels; +using Tango.TFS; namespace Tango.MachineStudio.UI.Views { @@ -20,16 +22,47 @@ namespace Tango.MachineStudio.UI.Views /// </summary> public partial class ReportIssueView : UserControl { + private ReportIssueViewVM _vm; + public ReportIssueView() { InitializeComponent(); this.Loaded += ReportIssueView_Loaded; + this.DataContextChanged += ReportIssueView_DataContextChanged; + } + + private void ReportIssueView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + _vm = this.DataContext as ReportIssueViewVM; } private void ReportIssueView_Loaded(object sender, RoutedEventArgs e) { txt_title.Focus(); } + + private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) + { + _vm.WorkItem.Area = e.NewValue as Area; + toggleArea.IsChecked = false; + } + + private TreeView tree; + + private void TreeView_Loaded(object sender, RoutedEventArgs e) + { + tree = sender as TreeView; + tree.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged; + } + + private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e) + { + if (tree.ItemContainerGenerator.Status == System.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated) + { + TreeViewItem i = tree.ItemContainerGenerator.ContainerFromIndex(0) as TreeViewItem; + i.IsExpanded = true; + } + } } } |
