Skip to content

Commit

Permalink
Updated MahApps.Metro, code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
arbitrarybytes committed Apr 20, 2019
1 parent cf09dea commit 8b1d4f1
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 63 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################

/.vs
/EasyHosts/obj/Debug/App.baml
/EasyHosts/obj/Debug/App.g.cs
/EasyHosts/obj/Debug/App.g.i.cs
/EasyHosts/obj/Release/EasyHosts.csproj.CoreCompileInputs.cache
/EasyHosts/obj/Release/App.g.cs
/EasyHosts/obj/Release/App.baml
/EasyHosts/obj/Debug/EasyHosts.csprojAssemblyReference.cache
/EasyHosts/obj/Debug/EasyHosts.csproj.CoreCompileInputs.cache
/Deploy
/EasyHosts/obj
/packages
11 changes: 8 additions & 3 deletions EasyHosts/EasyHosts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.AvalonEdit, Version=4.4.2.9744, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AvalonEdit.4.4.2.9744\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=0.14.0.98, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MahApps.Metro.0.14.0-ALPHA98\lib\net45\MahApps.Metro.dll</HintPath>
<Reference Include="MahApps.Metro, Version=1.6.5.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.6.5\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Prism.Mvvm">
<HintPath>..\packages\Prism.Mvvm.1.0.0\lib\net45\Microsoft.Practices.Prism.Mvvm.dll</HintPath>
Expand All @@ -85,6 +87,9 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml">
Expand Down
6 changes: 3 additions & 3 deletions EasyHosts/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Vaibhav Sharma")]
[assembly: AssemblyProduct("Easy Hosts")]
[assembly: AssemblyCopyright("Copyright © Vaibhav Sharma 2018")]
[assembly: AssemblyCopyright("Copyright © Vaibhav Sharma 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -49,5 +49,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.2015.0308.0")]
[assembly: AssemblyFileVersion("2.2015.0308.0")]
[assembly: AssemblyVersion("2.2019.320.0")]
[assembly: AssemblyFileVersion("2.2019.320.0")]
18 changes: 5 additions & 13 deletions EasyHosts/Shell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
xmlns:viewModels="clr-namespace:EasyHosts.ViewModels"
WindowStartupLocation="CenterScreen" WindowState="Maximized"
WindowTransitionsEnabled="True" ShowIconOnTitleBar="False"
ShowWindowCommandsOnTop="False" GlowBrush="{DynamicResource AccentColorBrush}"
RightWindowCommandsOverlayBehavior="Always"
GlowBrush="{DynamicResource AccentColorBrush}"
ResizeMode="CanResizeWithGrip" MinHeight="480" MinWidth="760" TitleCaps="True"
Title="EASY HOSTS" Icon="eh.ico" >
<controls:MetroWindow.DataContext>
Expand Down Expand Up @@ -166,14 +167,6 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<!--<StackPanel Grid.Row="0" Margin="10" Orientation="Horizontal">
<Image Height="36" Width="36" Margin="10"
Source="Resources/add.png" Stretch="Uniform"
VerticalAlignment="Center" />
<TextBlock FontWeight="ExtraLight" FontSize="20" Text="EASY HOSTS"
Margin="10" VerticalAlignment="Center" />
</StackPanel>-->
<TextBlock Grid.Row="0" FontWeight="ExtraLight" FontSize="16" Text="FILE NAME"
Margin="10" VerticalAlignment="Center" />

Expand All @@ -185,7 +178,7 @@
Content=" CREATE " />

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


</Grid>
Expand All @@ -194,12 +187,12 @@

</controls:FlyoutsControl>
</controls:MetroWindow.Flyouts>
<controls:MetroWindow.WindowCommands>
<controls:MetroWindow.RightWindowCommands>
<controls:WindowCommands>
<Button Content="SETTINGS" Cursor="Hand" Click="SettingsClicked"/>
<Button Content="ABOUT" Cursor="Hand" Click="AboutClicked" />
</controls:WindowCommands>
</controls:MetroWindow.WindowCommands>
</controls:MetroWindow.RightWindowCommands>

<controls:MetroAnimatedTabControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
Expand All @@ -215,5 +208,4 @@
<views:Hosts DataContext="{Binding Hosts}" x:Name="HostsView" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
</controls:MetroTabItem>
</controls:MetroAnimatedTabControl>

</controls:MetroWindow>
9 changes: 0 additions & 9 deletions EasyHosts/ViewModels/HostsEntryViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ public HostsEntryViewModel()
IsDirty = false;
}

//public string HostEntryName
//{
// get { return _hostEntryName; }
// set
// {
// _hostEntryName = value;
// OnPropertyChanged("HostEntryName");
// }
//}
public string HostEntryPath
{
get { return _hostEntryPath; }
Expand Down
35 changes: 1 addition & 34 deletions EasyHosts/Views/Hosts.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,6 @@ private void OpenCommandBindingExecuted(object sender, ExecutedRoutedEventArgs e
}
}

//private void OpenCommandBindingCanExecute(object sender, CanExecuteRoutedEventArgs e)
//{

// if (HostsContext != null && HostsContext.SelectedHostFile != null)
// {
// e.CanExecute = true; //define if command can be executed
// return;
// }

// e.CanExecute = false;
//}

private void SaveCommandBindingExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (HostsContext == null || HostsContext.HostFiles == null || HostsContext.SelectedHostFile == null)
Expand Down Expand Up @@ -325,26 +313,5 @@ private void AddNewHostsCommandBindingExecuted(object sender, ExecutedRoutedEven
}

#endregion

//private async void ShowInputDialog(object sender, RoutedEventArgs e)
//{
// /*var dlgSettings = new MetroDialogSettings()
// {
// AffirmativeButtonText = " create host file ",
// AnimateShow = true,
// AnimateHide = true,
// ColorScheme = MetroDialogColorScheme.Theme,
// NegativeButtonText = " cancel "
// };*/
// var metroWin = Application.Current.MainWindow as MetroWindow;

// //var result = await metroWin.ShowInputAsync("new host file", "please enter the host file name:", dlgSettings);
// //var result = await this.ShowInputAsync("Hello!", "What is your name?");

// //if (result == null) //user pressed cancel
// //return;

// await metroWin.ShowMessageAsync("new file created", "hello!");
//}
}
}
}
3 changes: 2 additions & 1 deletion EasyHosts/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<packages>
<package id="AvalonEdit" version="4.4.2.9744" targetFramework="net45" />
<package id="CommonServiceLocator" version="1.2" targetFramework="net45" />
<package id="MahApps.Metro" version="0.14.0-ALPHA98" targetFramework="net45" />
<package id="ControlzEx" version="3.0.2.4" targetFramework="net45" />
<package id="MahApps.Metro" version="1.6.5" targetFramework="net45" />
<package id="Prism" version="5.0.0" targetFramework="net45" />
<package id="Prism.Composition" version="5.0.0" targetFramework="net45" />
<package id="Prism.Interactivity" version="5.0.0" targetFramework="net45" />
Expand Down

0 comments on commit 8b1d4f1

Please sign in to comment.