Skip to content

Commit

Permalink
Remove Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
aloisdg committed Apr 24, 2015
1 parent f6ebcfc commit d8afef0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
32 changes: 32 additions & 0 deletions CountPages/CountPages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<NuGetPackageImportStamp>5e446713</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -145,6 +160,23 @@
<Name>Counter</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
9 changes: 2 additions & 7 deletions CountPages/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@
</i:EventTrigger>
</i:Interaction.Triggers>

<ProgressBar Visibility="{Binding LoaderVisibility}" IsIndeterminate="True" />
<ProgressBar IsHitTestVisible="False" Visibility="{Binding LoaderVisibility}" IsIndeterminate="True" />

<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="ValueChanged">
<command:EventToCommand Command="{Binding Mode=OneWay, Path=VolumeChanged}" PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>-->
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
Expand Down
9 changes: 5 additions & 4 deletions CountPages/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows;

namespace CountPages.ViewModel
Expand All @@ -22,8 +23,8 @@ namespace CountPages.ViewModel
/// </summary>
public class MainViewModel : ViewModelBase
{
public uint PageCount { get; private set; }
public Visibility LoaderVisibility { get; private set; }
public uint PageCount { get; set; }
public Visibility LoaderVisibility { get; set; }

public RelayCommand<object> Dropped { get; private set; }

Expand Down Expand Up @@ -52,22 +53,22 @@ private void ExecuteDropped(object o)
private void ReadFiles(DragEventArgs e)
{
if (!e.Data.GetDataPresent(DataFormats.FileDrop)) return;
SwitchLoaderVisibility();
//SwitchLoaderVisibility();
try
{
var paths = (string[])e.Data.GetData(DataFormats.FileDrop);
PageCount = Convert.ToUInt32(paths
.Sum(path => new Document(path, new FileStream(path, FileMode.Open)).Count));

RaisePropertyChanged("PageCount");
//SwitchLoaderVisibility();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
SwitchLoaderVisibility();
}
}

Expand Down

0 comments on commit d8afef0

Please sign in to comment.