Skip to content

Commit

Permalink
Moved tools to achorable
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Rolfe authored and Isaac Rolfe committed Aug 25, 2021
1 parent 8c84f96 commit cbd6a84
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 32 deletions.
16 changes: 16 additions & 0 deletions JdaTools.Studio/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
</ResourceDictionary.MergedDictionaries>
<converters:InverseBoolConverter x:Key="InverseBoolConverter"/>
<converters:FileToContentConverter x:Key="FileToContentConverter"/>
<Style TargetType="TextBlock" BasedOn="{StaticResource MahApps.Styles.TextBlock}">
<Setter Property="Margin" Value="2"></Setter>
</Style>
<Style TargetType="TextBox" BasedOn="{StaticResource MahApps.Styles.TextBox}">
<Setter Property="Margin" Value="2"></Setter>
</Style>
<Style TargetType="PasswordBox" BasedOn="{StaticResource MahApps.Styles.PasswordBox}">
<Setter Property="Margin" Value="2"></Setter>
</Style>
<Style TargetType="ComboBox" BasedOn="{StaticResource MahApps.Styles.ComboBox}">
<Setter Property="Margin" Value="2"></Setter>
</Style>
<Style TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button}">
<Setter Property="Margin" Value="2"></Setter>
</Style>

</ResourceDictionary>
</Application.Resources>
</Application>
7 changes: 7 additions & 0 deletions JdaTools.Studio/Models/EditorHostViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JdaTools.Studio.Models
{
public class EditorHostViewModel
{

}
}
4 changes: 2 additions & 2 deletions JdaTools.Studio/ViewModels/CommandsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public CommandsViewModel(MocaClient mocaClient, SchemaExplorer schemaExplorer, I
_eventAggregator.SubscribeOnPublishedThread(this);
}

public override string DisplayName { get; set; } = "MOCA COMMANDS";
public override string DisplayName { get; set; } = "COMMANDS";

public IEnumerable<CommandDefinition> Commands => GetFilteredCommands();

Expand All @@ -56,7 +56,7 @@ private IEnumerable<CommandDefinition> GetFilteredCommands()
commands = _schemaExplorer.Commands?.Where(t => t.CommandName.Contains(SearchString, StringComparison.InvariantCultureIgnoreCase)); //Apply filter from search
}
//TODO add pagination listview with 10,000 items is slow
return commands?.Take(100);
return commands?.Take(200);
}

private ICommand refreshCommand;
Expand Down
6 changes: 3 additions & 3 deletions JdaTools.Studio/ViewModels/EditorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public bool IsBusy
set => SetProperty(ref _isBusy, value);
}

private DataTable resultData;
private DataTable _resultData;

public DataTable ResultData
{
get => resultData;
set => SetProperty(ref resultData, value);
get => _resultData;
set => SetProperty(ref _resultData, value);
}
private string _title = "NEW EDITOR";

Expand Down
4 changes: 2 additions & 2 deletions JdaTools.Studio/ViewModels/FilesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public FilesViewModel(MocaClient mocaClient, SchemaExplorer schemaExplorer, IEve
_schemaExplorer = schemaExplorer;
_eventAggregator = eventAggregator;
_eventAggregator.SubscribeOnPublishedThread(this);

}
public override string DisplayName { get; set; } = "MOCA FILES";

public override string DisplayName { get; set; } = "FILES";

public override string ToString()
{
Expand Down
2 changes: 1 addition & 1 deletion JdaTools.Studio/Views/CommandsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Content="{iconpacks:Material Kind=Replay}" HorizontalAlignment="Right" Command="{Binding RefreshCommand}"/>
</Grid>
<ListView Grid.Row="1" x:Name="CommandsListView" ItemsSource="{Binding Commands}"
>
VirtualizingStackPanel.IsVirtualizing="True">

</ListView>
</Grid>
Expand Down
12 changes: 12 additions & 0 deletions JdaTools.Studio/Views/EditorHostView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<UserControl x:Class="JdaTools.Studio.Views.EditorHostView"
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:JdaTools.Studio.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>

</Grid>
</UserControl>
28 changes: 28 additions & 0 deletions JdaTools.Studio/Views/EditorHostView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace JdaTools.Studio.Views
{
/// <summary>
/// Interaction logic for EditorHostView.xaml
/// </summary>
public partial class EditorHostView : UserControl
{
public EditorHostView()
{
InitializeComponent();
}
}
}
35 changes: 12 additions & 23 deletions JdaTools.Studio/Views/ShellView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
xmlns:local="clr-namespace:JdaTools.Studio"
xmlns:views="clr-namespace:JdaTools.Studio.Views"
xmlns:viewmodels="clr-namespace:JdaTools.Studio.ViewModels"
SaveWindowPosition="True"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewmodels:ShellViewModel, IsDesignTimeCreatable=True}"
xmlns:iconpacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:cm="http://caliburnmicro.com"
xmlns:simpleChildWindow="http://metro.mahapps.com/winfx/xaml/simplechildwindow"
Title="JDA EXPLORER" Height="450" Width="800">
Title="JDA EXPLORER" Height="900" Width="1600">
<Window.InputBindings>
<KeyBinding Modifiers="Control"
Key="N"
Expand All @@ -24,37 +25,18 @@
Key="O"
Command="{Binding OpenCommand}"/>
</Window.InputBindings>

<Grid>
<Grid IsEnabled="{Binding IsEnabled}">

<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<DockingManager Grid.Column="0" x:Name="Tools" DocumentsSource="{Binding Tools}">
<DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Content.DisplayName}"/>
</DataTemplate>
</DockingManager.DocumentHeaderTemplate>
<DockingManager.LayoutItemTemplate>
<DataTemplate>
<ContentControl cm:View.Model="{Binding Content}" IsTabStop="False"/>
</DataTemplate>
</DockingManager.LayoutItemTemplate>
</DockingManager>
<GridSplitter Grid.Column="1" Margin="2,0,2,0"
Width="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Center"/>
<Grid Grid.Column="2" Margin="0 2 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
Expand All @@ -80,7 +62,14 @@
</StackPanel>
<DockingManager Grid.Row="1" x:Name="Editors" DocumentsSource="{Binding Editors}"
ActiveContent="{Binding SelectedEditor, Mode=TwoWay}"
ActiveContentChanged="Editors_OnActiveContentChanged">
ActiveContentChanged="Editors_OnActiveContentChanged"
AnchorablesSource="{Binding Tools}"
>
<DockingManager.AnchorableHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Content.DisplayName}"/>
</DataTemplate>
</DockingManager.AnchorableHeaderTemplate>
<DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Content.Title}"/>
Expand All @@ -99,8 +88,8 @@
Title="CONNECT"
ShowCloseButton="False"
CloseByEscape="False"
IsOpen="True">
<ContentControl x:Name="Login"></ContentControl>
IsOpen="True" Margin="-10,3,10,-3">
<ContentControl x:Name="Login" Margin="15 5 15 15"></ContentControl>
</simpleChildWindow:ChildWindow>

</Grid>
Expand Down
4 changes: 3 additions & 1 deletion JdaTools.Studio/Views/TablesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
<Button Grid.Column="1"
Content="{iconpacks:Material Kind=Replay}" HorizontalAlignment="Right" Command="{Binding RefreshCommand}"/>
</Grid>
<TreeView Grid.Row="1" x:Name="TableListView" ItemsSource="{Binding Tables}">
<TreeView Grid.Row="1" x:Name="TableListView" ItemsSource="{Binding Tables}"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Columns}">
<TextBlock Text="{Binding}">
Expand Down

0 comments on commit cbd6a84

Please sign in to comment.