Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Full support for MKD extension #84

Merged
merged 1 commit into from

2 participants

Drew Marsh Ian Randall
Drew Marsh

This is a follow up with full support for the MKD extension that @shanselman started in pull request 17c5704.

  • added checkbox UI element for extension to settings dialog
  • added binding property to the model for the MKD extension
  • added support for loading/saving whether the setting is associated in the registry
Drew Marsh drub0y Add full support for MKD extension to settings dialog
- added checkbox UI element for extension
- added binding property to the model for the MKD extension
- added support for loading/saving whether the setting is associated in the registry
c8a3b6b
Ian Randall IanRandall merged commit 3127454 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 25, 2012
  1. Drew Marsh

    Add full support for MKD extension to settings dialog

    drub0y authored
    - added checkbox UI element for extension
    - added binding property to the model for the MKD extension
    - added support for loading/saving whether the setting is associated in the registry
This page is out of date. Refresh to see the latest.
9 src/MarkPad/Settings/SettingsView.xaml
View
@@ -6,7 +6,7 @@
MouseLeftButtonDown="DragMoveWindow"
ShowInTaskbar="False"
SnapsToDevicePixels="True"
- WindowStartupLocation="CenterOwner" Width="300" Height="320" ResizeMode="NoResize">
+ WindowStartupLocation="CenterOwner" Width="300" Height="365" ResizeMode="NoResize">
<i:Interaction.Behaviors>
<Behaviours:BorderlessWindowBehavior ResizeWithGrip="False" />
</i:Interaction.Behaviors>
@@ -34,8 +34,8 @@
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
+ <RowDefinition Height="93" />
+ <RowDefinition Height="107*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top" FontFamily="Segoe UI" FontWeight="Light" FontSize="29.333" Text="settings" />
@@ -50,7 +50,8 @@
<CheckBox x:Name="FileMDBinding" Content=".md" />
<CheckBox x:Name="FileMDownBinding" Content=".mdown" />
<CheckBox x:Name="FileMarkdownBinding" Content=".markdown" />
- </StackPanel>
+ <CheckBox x:Name="FileMKDBinding" Content=".mkd" />
+ </StackPanel>
<StackPanel Grid.Row="2" Margin="0 10 0 0">
<TextBlock Text="Blog Sites" />
<StackPanel Orientation="Horizontal">
7 src/MarkPad/Settings/SettingsViewModel.cs
View
@@ -35,6 +35,9 @@ public SettingsViewModel(ISettingsService settingsService, IWindowManager window
FileMDownBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[2]) &&
!string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[2]).GetValue("").ToString());
+
+ FileMKDBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[3]) &&
+ !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[3]).GetValue("").ToString());
}
var blogs = settingsService.Get<List<BlogSetting>>("Blogs") ?? new List<BlogSetting>();
@@ -45,6 +48,7 @@ public SettingsViewModel(ISettingsService settingsService, IWindowManager window
public bool FileMDBinding { get; set; }
public bool FileMarkdownBinding { get; set; }
public bool FileMDownBinding { get; set; }
+ public bool FileMKDBinding { get; set; }
public BlogSetting CurrentBlog { get; set; }
public ObservableCollection<BlogSetting> Blogs { get; set; }
@@ -129,7 +133,8 @@ private void UpdateExtensionRegistryKeys()
{
if ((i == 0 && FileMDBinding) ||
(i == 1 && FileMarkdownBinding) ||
- (i == 2 && FileMDownBinding))
+ (i == 2 && FileMDownBinding) ||
+ (i == 3 && FileMKDBinding))
extensionKey.SetValue("", markpadKeyName);
else
extensionKey.SetValue("", "");
Something went wrong with that request. Please try again.