Added project templates, work on document template

This commit is contained in:
2014-08-16 00:39:31 +03:00
parent ef8aec25b7
commit 5f4dead9ec
30 changed files with 373 additions and 130 deletions

View File

@ -23,7 +23,7 @@
Width="32" Height="32" Margin="2"
Stretch="Uniform" VerticalAlignment="Top" />
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<TextBlock Text="{Binding Name}" FontWeight="Bold" />
<TextBlock Text="{Binding DisplayText}" FontWeight="Bold" />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DockPanel>

View File

@ -13,9 +13,8 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListView Name="listTemplates" Grid.Row="0" SelectedIndex="0"
IsEnabled="False">
<ListView Name="listTemplates" Grid.Row="0" Margin="1px"
SelectionChanged="listTemplates_SelectionChanged">
<ListView.ItemTemplate>
<DataTemplate>
<DockPanel>
@ -23,21 +22,12 @@
Width="32" Height="32" Margin="2"
Stretch="Uniform" VerticalAlignment="Top" />
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<TextBlock Text="{Binding Name}" FontWeight="Bold" />
<TextBlock Text="{Binding DisplayText}" FontWeight="Bold" />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DockPanel>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock FontWeight="Bold" FontSize="13pt" Text="{Binding Name}" />
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
<Grid Grid.Row="1">

View File

@ -13,6 +13,8 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using RainmeterStudio.Business;
using RainmeterStudio.Core.Documents;
using RainmeterStudio.Core.Model;
using RainmeterStudio.UI.Controller;
namespace RainmeterStudio.UI.Dialogs
{
@ -54,11 +56,11 @@ namespace RainmeterStudio.UI.Dialogs
/// <summary>
/// Gets or sets the currently selected file format
/// </summary>
public DocumentTemplate SelectedTemplate
public IDocumentTemplate SelectedTemplate
{
get
{
return listTemplates.SelectedItem as DocumentTemplate;
return listTemplates.SelectedItem as IDocumentTemplate;
}
set
{
@ -121,7 +123,7 @@ namespace RainmeterStudio.UI.Dialogs
#endregion
public CreateProjectDialog()
public CreateProjectDialog(ProjectController projectController)
{
InitializeComponent();
@ -132,6 +134,9 @@ namespace RainmeterStudio.UI.Dialogs
// Set data context
DataContext = this;
// Populate templates
listTemplates.ItemsSource = projectController.ProjectTemplates.OrderBy(x => x.DisplayText);
// Focus on name textbox
textName.Focus();
}
@ -208,5 +213,9 @@ namespace RainmeterStudio.UI.Dialogs
{
UpdatePath();
}
private void listTemplates_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
}
}