Skip to content

Commit 8b1d4f1

Browse files
Updated MahApps.Metro, code clean up
1 parent cf09dea commit 8b1d4f1

7 files changed

Lines changed: 35 additions & 63 deletions

File tree

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
################################################################################
2+
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3+
################################################################################
4+
5+
/.vs
6+
/EasyHosts/obj/Debug/App.baml
7+
/EasyHosts/obj/Debug/App.g.cs
8+
/EasyHosts/obj/Debug/App.g.i.cs
9+
/EasyHosts/obj/Release/EasyHosts.csproj.CoreCompileInputs.cache
10+
/EasyHosts/obj/Release/App.g.cs
11+
/EasyHosts/obj/Release/App.baml
12+
/EasyHosts/obj/Debug/EasyHosts.csprojAssemblyReference.cache
13+
/EasyHosts/obj/Debug/EasyHosts.csproj.CoreCompileInputs.cache
14+
/Deploy
15+
/EasyHosts/obj
16+
/packages

EasyHosts/EasyHosts.csproj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@
6969
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
7070
</PropertyGroup>
7171
<ItemGroup>
72+
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
73+
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath>
74+
</Reference>
7275
<Reference Include="ICSharpCode.AvalonEdit, Version=4.4.2.9744, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
7376
<SpecificVersion>False</SpecificVersion>
7477
<HintPath>..\packages\AvalonEdit.4.4.2.9744\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
7578
</Reference>
76-
<Reference Include="MahApps.Metro, Version=0.14.0.98, Culture=neutral, processorArchitecture=MSIL">
77-
<SpecificVersion>False</SpecificVersion>
78-
<HintPath>..\packages\MahApps.Metro.0.14.0-ALPHA98\lib\net45\MahApps.Metro.dll</HintPath>
79+
<Reference Include="MahApps.Metro, Version=1.6.5.1, Culture=neutral, processorArchitecture=MSIL">
80+
<HintPath>..\packages\MahApps.Metro.1.6.5\lib\net45\MahApps.Metro.dll</HintPath>
7981
</Reference>
8082
<Reference Include="Microsoft.Practices.Prism.Mvvm">
8183
<HintPath>..\packages\Prism.Mvvm.1.0.0\lib\net45\Microsoft.Practices.Prism.Mvvm.dll</HintPath>
@@ -85,6 +87,9 @@
8587
</Reference>
8688
<Reference Include="System" />
8789
<Reference Include="System.Drawing" />
90+
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
91+
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll</HintPath>
92+
</Reference>
8893
<Reference Include="System.Xml" />
8994
<Reference Include="System.Core" />
9095
<Reference Include="System.Xaml">

EasyHosts/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("Vaibhav Sharma")]
1212
[assembly: AssemblyProduct("Easy Hosts")]
13-
[assembly: AssemblyCopyright("Copyright © Vaibhav Sharma 2018")]
13+
[assembly: AssemblyCopyright("Copyright © Vaibhav Sharma 2019")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -49,5 +49,5 @@
4949
// You can specify all the values or you can default the Build and Revision Numbers
5050
// by using the '*' as shown below:
5151
// [assembly: AssemblyVersion("1.0.*")]
52-
[assembly: AssemblyVersion("2.2015.0308.0")]
53-
[assembly: AssemblyFileVersion("2.2015.0308.0")]
52+
[assembly: AssemblyVersion("2.2019.320.0")]
53+
[assembly: AssemblyFileVersion("2.2019.320.0")]

EasyHosts/Shell.xaml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
xmlns:viewModels="clr-namespace:EasyHosts.ViewModels"
77
WindowStartupLocation="CenterScreen" WindowState="Maximized"
88
WindowTransitionsEnabled="True" ShowIconOnTitleBar="False"
9-
ShowWindowCommandsOnTop="False" GlowBrush="{DynamicResource AccentColorBrush}"
9+
RightWindowCommandsOverlayBehavior="Always"
10+
GlowBrush="{DynamicResource AccentColorBrush}"
1011
ResizeMode="CanResizeWithGrip" MinHeight="480" MinWidth="760" TitleCaps="True"
1112
Title="EASY HOSTS" Icon="eh.ico" >
1213
<controls:MetroWindow.DataContext>
@@ -166,14 +167,6 @@
166167
<RowDefinition Height="Auto" />
167168
<RowDefinition Height="*" />
168169
</Grid.RowDefinitions>
169-
170-
<!--<StackPanel Grid.Row="0" Margin="10" Orientation="Horizontal">
171-
<Image Height="36" Width="36" Margin="10"
172-
Source="Resources/add.png" Stretch="Uniform"
173-
VerticalAlignment="Center" />
174-
<TextBlock FontWeight="ExtraLight" FontSize="20" Text="EASY HOSTS"
175-
Margin="10" VerticalAlignment="Center" />
176-
</StackPanel>-->
177170
<TextBlock Grid.Row="0" FontWeight="ExtraLight" FontSize="16" Text="FILE NAME"
178171
Margin="10" VerticalAlignment="Center" />
179172

@@ -185,7 +178,7 @@
185178
Content=" CREATE " />
186179

187180
<TextBlock Grid.Row="3" Margin="10" FontSize="12" x:Name="NewFileMsg"
188-
Text="Just the file name (we'll manage extensions)."/>
181+
Text="Just the file name (we'll manage the extensions)."/>
189182

190183

191184
</Grid>
@@ -194,12 +187,12 @@
194187

195188
</controls:FlyoutsControl>
196189
</controls:MetroWindow.Flyouts>
197-
<controls:MetroWindow.WindowCommands>
190+
<controls:MetroWindow.RightWindowCommands>
198191
<controls:WindowCommands>
199192
<Button Content="SETTINGS" Cursor="Hand" Click="SettingsClicked"/>
200193
<Button Content="ABOUT" Cursor="Hand" Click="AboutClicked" />
201194
</controls:WindowCommands>
202-
</controls:MetroWindow.WindowCommands>
195+
</controls:MetroWindow.RightWindowCommands>
203196

204197
<controls:MetroAnimatedTabControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
205198
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
@@ -215,5 +208,4 @@
215208
<views:Hosts DataContext="{Binding Hosts}" x:Name="HostsView" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
216209
</controls:MetroTabItem>
217210
</controls:MetroAnimatedTabControl>
218-
219211
</controls:MetroWindow>

EasyHosts/ViewModels/HostsEntryViewModel.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ public HostsEntryViewModel()
88
IsDirty = false;
99
}
1010

11-
//public string HostEntryName
12-
//{
13-
// get { return _hostEntryName; }
14-
// set
15-
// {
16-
// _hostEntryName = value;
17-
// OnPropertyChanged("HostEntryName");
18-
// }
19-
//}
2011
public string HostEntryPath
2112
{
2213
get { return _hostEntryPath; }

EasyHosts/Views/Hosts.xaml.cs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,6 @@ private void OpenCommandBindingExecuted(object sender, ExecutedRoutedEventArgs e
212212
}
213213
}
214214

215-
//private void OpenCommandBindingCanExecute(object sender, CanExecuteRoutedEventArgs e)
216-
//{
217-
218-
// if (HostsContext != null && HostsContext.SelectedHostFile != null)
219-
// {
220-
// e.CanExecute = true; //define if command can be executed
221-
// return;
222-
// }
223-
224-
// e.CanExecute = false;
225-
//}
226-
227215
private void SaveCommandBindingExecuted(object sender, ExecutedRoutedEventArgs e)
228216
{
229217
if (HostsContext == null || HostsContext.HostFiles == null || HostsContext.SelectedHostFile == null)
@@ -325,26 +313,5 @@ private void AddNewHostsCommandBindingExecuted(object sender, ExecutedRoutedEven
325313
}
326314

327315
#endregion
328-
329-
//private async void ShowInputDialog(object sender, RoutedEventArgs e)
330-
//{
331-
// /*var dlgSettings = new MetroDialogSettings()
332-
// {
333-
// AffirmativeButtonText = " create host file ",
334-
// AnimateShow = true,
335-
// AnimateHide = true,
336-
// ColorScheme = MetroDialogColorScheme.Theme,
337-
// NegativeButtonText = " cancel "
338-
// };*/
339-
// var metroWin = Application.Current.MainWindow as MetroWindow;
340-
341-
// //var result = await metroWin.ShowInputAsync("new host file", "please enter the host file name:", dlgSettings);
342-
// //var result = await this.ShowInputAsync("Hello!", "What is your name?");
343-
344-
// //if (result == null) //user pressed cancel
345-
// //return;
346-
347-
// await metroWin.ShowMessageAsync("new file created", "hello!");
348-
//}
349316
}
350-
}
317+
}

EasyHosts/packages.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<packages>
33
<package id="AvalonEdit" version="4.4.2.9744" targetFramework="net45" />
44
<package id="CommonServiceLocator" version="1.2" targetFramework="net45" />
5-
<package id="MahApps.Metro" version="0.14.0-ALPHA98" targetFramework="net45" />
5+
<package id="ControlzEx" version="3.0.2.4" targetFramework="net45" />
6+
<package id="MahApps.Metro" version="1.6.5" targetFramework="net45" />
67
<package id="Prism" version="5.0.0" targetFramework="net45" />
78
<package id="Prism.Composition" version="5.0.0" targetFramework="net45" />
89
<package id="Prism.Interactivity" version="5.0.0" targetFramework="net45" />

0 commit comments

Comments
 (0)