Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes in windows phone user control and samples #102

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Samples/WindowsPhone7.1/WindowsPhone.Sample.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio Express 2012 for Windows Phone
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsPhone.Sample", "WindowsPhone.Sample\WindowsPhone.Sample.csproj", "{BC6808C6-5CEF-4D29-A23B-D2155334243D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zxing.wp7.1", "..\..\src\ZXing.Net\zxing.wp7.1.csproj", "{EC6F52B8-AF75-4FA2-85C1-82BF77861FFF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZXing.Net.Mobile.WindowsPhone7", "..\..\src\ZXing.Net.Mobile\ZXing.Net.Mobile.WindowsPhone7.csproj", "{CD15825D-D4CC-4BC4-9163-9CFB460AF836}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZXing.Net.Mobile.WindowsPhone7.1", "..\..\src\ZXing.Net.Mobile\ZXing.Net.Mobile.WindowsPhone7.1.csproj", "{CD15825D-D4CC-4BC4-9163-9CFB460AF836}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -37,12 +37,16 @@ Global
{EC6F52B8-AF75-4FA2-85C1-82BF77861FFF}.Release|x86.ActiveCfg = Release|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|ARM.ActiveCfg = Debug|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|x86.ActiveCfg = Debug|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|ARM.ActiveCfg = Debug|ARM
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|ARM.Build.0 = Debug|ARM
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|x86.ActiveCfg = Debug|x86
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Debug|x86.Build.0 = Debug|x86
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|Any CPU.Build.0 = Release|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|ARM.ActiveCfg = Release|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|x86.ActiveCfg = Release|Any CPU
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|ARM.ActiveCfg = Release|ARM
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|ARM.Build.0 = Release|ARM
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|x86.ActiveCfg = Release|x86
{CD15825D-D4CC-4BC4-9163-9CFB460AF836}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<Reference Include="Microsoft.Phone.Interop" />
<Reference Include="System.Threading.Tasks.WP71, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\System.Threading.Tasks.WP71.dll</HintPath>
<HintPath>..\packages\System.Threading.Tasks.3.0.1\lib\sl4-wp71\System.Threading.Tasks.WP71.dll</HintPath>
</Reference>
<Reference Include="System.Windows" />
<Reference Include="system" />
Expand All @@ -61,7 +61,10 @@
<Reference Include="System.Xml" />
<Reference Include="mscorlib.extensions" />
<Reference Include="WriteableBitmapExWinPhone">
<HintPath>.\WriteableBitmapExWinPhone.dll</HintPath>
<HintPath>..\packages\WriteableBitmapEx.1.0.12.0\lib\sl4-wp71\WriteableBitmapExWinPhone.dll</HintPath>
</Reference>
<Reference Include="WriteableBitmapExWinPhoneXnaDependant">
<HintPath>..\packages\WriteableBitmapEx.1.0.12.0\lib\sl4-wp71\WriteableBitmapExWinPhoneXnaDependant.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -98,10 +101,6 @@
<Content Include="SplashScreenImage.jpg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\ZXing.Net.Mobile\ZXing.Net.Mobile.WindowsPhone7.csproj">
<Project>{CD15825D-D4CC-4BC4-9163-9CFB460AF836}</Project>
<Name>ZXing.Net.Mobile.WindowsPhone7</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\ZXing.Net\zxing.wp7.1.csproj">
<Project>{EC6F52B8-AF75-4FA2-85C1-82BF77861FFF}</Project>
<Name>zxing.wp7.1</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Threading.Tasks" version="3.0.1" targetFramework="wp71" />
<package id="WriteableBitmapEx" version="1.0.12.0" targetFramework="wp71" />
</packages>
20 changes: 10 additions & 10 deletions Samples/WindowsPhone8/Sample.WindowsPhone8/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ private void buttonScanCustom_Click(object sender, RoutedEventArgs e)
{
customOverlayElement = this.customOverlay.Children[0];
this.customOverlay.Children.RemoveAt(0);
}

//Wireup our buttons from the custom overlay
this.buttonCancel.Click += (s, e2) =>
{
scanner.Cancel();
};
this.buttonFlash.Click += (s, e2) =>
{
scanner.ToggleTorch();
};
//Wireup our buttons from the custom overlay
this.buttonCancel.Click += (s, e2) =>
{
scanner.Cancel();
};
this.buttonFlash.Click += (s, e2) =>
{
scanner.ToggleTorch();
};
}

//Set our custom overlay and enable it
scanner.CustomOverlay = customOverlayElement;
Expand Down
15 changes: 12 additions & 3 deletions src/ZXing.Net.Mobile/WindowsPhone/ScanPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public partial class ScanPage : PhoneApplicationPage
public static event Action OnRequestAutoFocus;
public static event Action OnRequestCancel;
public static event Func<bool> OnRequestIsTorchOn;

public static bool RequestIsTorchOn()
{
var evt = OnRequestIsTorchOn;
return evt != null && evt();
}

public static void RequestTorch(bool on)
public static void RequestTorch(bool on)
{
var evt = OnRequestTorch;
if (evt != null)
Expand Down Expand Up @@ -106,7 +106,16 @@ protected override void OnNavigatedTo(NavigationEventArgs e)

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
{
try { scannerControl.StopScanning(); }
try
{
OnRequestAutoFocus = null;
OnRequestTorch = null;
OnRequestToggleTorch = null;
OnRequestCancel = null;
OnRequestIsTorchOn = null;

scannerControl.StopScanning();
}
catch (Exception ex) { }

base.OnNavigatingFrom(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public void AutoFocus()

public void StopScanning()
{
gridCustomOverlay.Children.Remove(CustomOverlay);
_reader.Stop();
_reader = null;
}
Expand Down
8 changes: 4 additions & 4 deletions src/ZXing.Net.Mobile/ZXing.Net.Mobile.WindowsPhone7.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<ItemGroup>
<Reference Include="System.Threading.Tasks.WP71, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.Threading.Tasks.3.0.1\lib\sl4-wp71\System.Threading.Tasks.WP71.dll</HintPath>
<HintPath>..\..\Samples\WindowsPhone7.1\packages\System.Threading.Tasks.3.0.1\lib\sl4-wp71\System.Threading.Tasks.WP71.dll</HintPath>
</Reference>
<Reference Include="WriteableBitmapExWinPhone">
<HintPath>WindowsPhone\WriteableBitmapExWinPhone.dll</HintPath>
Expand Down Expand Up @@ -138,15 +138,15 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ZXing.Net\zxing.wp7.1.csproj">
<Project>{EC6F52B8-AF75-4FA2-85C1-82BF77861FFF}</Project>
<Name>zxing.wp7.1</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<ProjectExtensions />
Expand Down
2 changes: 1 addition & 1 deletion src/ZXing.Net.Mobile/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Threading.Tasks" version="3.0.1" targetFramework="wp71" />
<package id="System.Threading.Tasks" version="3.0.1" targetFramework="wp80" />
</packages>