Skip to content

Commit affa67e

Browse files
Removed obsolete System.Windows.Interactivity reference
1 parent b6d454b commit affa67e

File tree

7 files changed

+80
-39
lines changed

7 files changed

+80
-39
lines changed

BitcoinTransactionTool/BitcoinTransactionTool.csproj

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<WarningLevel>4</WarningLevel>
1616
<TargetFrameworkProfile />
17+
<IsWebBootstrapper>false</IsWebBootstrapper>
18+
<PublishUrl>publish\</PublishUrl>
19+
<Install>true</Install>
20+
<InstallFrom>Disk</InstallFrom>
21+
<UpdateEnabled>false</UpdateEnabled>
22+
<UpdateMode>Foreground</UpdateMode>
23+
<UpdateInterval>7</UpdateInterval>
24+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
25+
<UpdatePeriodically>false</UpdatePeriodically>
26+
<UpdateRequired>false</UpdateRequired>
27+
<MapFileExtensions>true</MapFileExtensions>
28+
<ApplicationRevision>0</ApplicationRevision>
29+
<ApplicationVersion>0.10.0.0</ApplicationVersion>
30+
<UseApplicationTrust>false</UseApplicationTrust>
31+
<BootstrapperEnabled>true</BootstrapperEnabled>
1732
</PropertyGroup>
1833
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1934
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -25,6 +40,7 @@
2540
<ErrorReport>prompt</ErrorReport>
2641
<WarningLevel>4</WarningLevel>
2742
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
43+
<Prefer32Bit>false</Prefer32Bit>
2844
</PropertyGroup>
2945
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3046
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -35,6 +51,7 @@
3551
<ErrorReport>prompt</ErrorReport>
3652
<WarningLevel>4</WarningLevel>
3753
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
54+
<Prefer32Bit>false</Prefer32Bit>
3855
</PropertyGroup>
3956
<PropertyGroup>
4057
<ApplicationIcon>Bitcoin Icon.png.ico</ApplicationIcon>
@@ -53,7 +70,6 @@
5370
<Reference Include="System.Drawing" />
5471
<Reference Include="System.Net.Http" />
5572
<Reference Include="System.Numerics" />
56-
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
5773
<Reference Include="System.Xml" />
5874
<Reference Include="Microsoft.CSharp" />
5975
<Reference Include="System.Core" />
@@ -236,6 +252,18 @@
236252
<ItemGroup>
237253
<Resource Include="Bitcoin Icon.png.ico" />
238254
</ItemGroup>
255+
<ItemGroup>
256+
<BootstrapperPackage Include=".NETFramework,Version=v4.6">
257+
<Visible>False</Visible>
258+
<ProductName>Microsoft .NET Framework 4.6 %28x86 and x64%29</ProductName>
259+
<Install>true</Install>
260+
</BootstrapperPackage>
261+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
262+
<Visible>False</Visible>
263+
<ProductName>.NET Framework 3.5 SP1</ProductName>
264+
<Install>false</Install>
265+
</BootstrapperPackage>
266+
</ItemGroup>
239267
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
240268
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
241269
Other similar extension points exist, see Microsoft.Common.targets.

BitcoinTransactionTool/MainWindow.xaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:vm="clr-namespace:BitcoinTransactionTool.ViewModels"
5-
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
6-
75
Title="Bitcoin Transaction Tool - Version Beta" Height="666" Width="673.164" FontSize="14" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen">
86
<Window.DataContext>
97
<vm:MainWindowViewModel/>
@@ -48,13 +46,10 @@
4846
<Label Content="LockTime:" HorizontalAlignment="Left" Margin="449,110,0,0" VerticalAlignment="Top" FontFamily="Comic Sans MS" FontWeight="Bold"/>
4947
<TextBox Text="{Binding LockTime, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="26" Margin="537,112,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="105"/>
5048

51-
<ListView x:Name="listView" HorizontalAlignment="Left" Height="190" Margin="10,149,0,0" VerticalAlignment="Top" Width="632" ItemsSource="{Binding Source={StaticResource AddressViewSource}}" SelectionMode="Multiple">
52-
<i:Interaction.Triggers>
53-
<i:EventTrigger EventName="SelectionChanged">
54-
<i:InvokeCommandAction CommandParameter="{Binding ElementName=listView, Path=SelectedItems}" Command="{Binding SelectionChangedCommand}" />
55-
</i:EventTrigger>
56-
</i:Interaction.Triggers>
57-
<ListView.Resources>
49+
<ListView x:Name="listView" HorizontalAlignment="Left" Height="190" Margin="10,149,0,0" VerticalAlignment="Top" Width="632"
50+
ItemsSource="{Binding Source={StaticResource AddressViewSource}}" SelectionMode="Multiple"
51+
SelectionChanged="ListView_SelectionChanged">
52+
<ListView.Resources>
5853
<Style TargetType="{x:Type GridViewColumnHeader}">
5954
<Setter Property="HorizontalContentAlignment" Value="Left" />
6055
</Style>
@@ -116,7 +111,8 @@
116111

117112
<ComboBox HorizontalAlignment="Left" Margin="539,486,0,0" VerticalAlignment="Top" Width="103" ItemsSource="{Binding WalletTypeList}" SelectedItem="{Binding SelectedWalletType}"/>
118113

119-
<Button Content="Make Tx" HorizontalAlignment="Left" Margin="459,486,0,0" VerticalAlignment="Top" Width="75" CommandParameter="{Binding SelectedItems, ElementName=listView}" Command="{Binding MakeTxCommand, Mode=OneWay}"/>
114+
<Button Content="Make Tx" HorizontalAlignment="Left" Margin="459,486,0,0" VerticalAlignment="Top" Width="75"
115+
Command="{Binding MakeTxCommand, Mode=OneWay}"/>
120116
<Button Content="QR" HorizontalAlignment="Left" Margin="459,516,0,0" VerticalAlignment="Top" Width="75" Command="{Binding ShowQrWindowCommand, Mode=OneWay}"/>
121117
<Button Content="Copy" HorizontalAlignment="Left" Margin="459,546,0,0" VerticalAlignment="Top" Width="75" Command="{Binding CopyTxCommand, Mode=OneWay}"/>
122118
<Button Content="JSON" HorizontalAlignment="Left" Margin="569,546,0,0" VerticalAlignment="Top" Width="75" Command="{Binding ShowJsonWindowCommand, Mode=OneWay}"/>

BitcoinTransactionTool/MainWindow.xaml.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file LICENCE or http://www.opensource.org/licenses/mit-license.php.
55

6+
using BitcoinTransactionTool.Models;
7+
using BitcoinTransactionTool.ViewModels;
8+
using System.Collections;
9+
using System.Collections.ObjectModel;
10+
using System.Linq;
611
using System.Windows;
12+
using System.Windows.Controls;
713

814
namespace BitcoinTransactionTool
915
{
@@ -21,5 +27,14 @@ private void Exit_Click(object sender, RoutedEventArgs e)
2127
{
2228
this.Close();
2329
}
30+
31+
private void ListView_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
32+
{
33+
ListView lv = sender as ListView;
34+
IList selected = lv.SelectedItems;
35+
36+
((MainWindowViewModel)DataContext).SelectedUTXOs =
37+
new ObservableCollection<UTXO>(selected.Cast<UTXO>());
38+
}
2439
}
2540
}

BitcoinTransactionTool/ViewModels/MainWindowViewModel.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public MainWindowViewModel()
3232

3333
// Initializing Commands.
3434
GetUTXOCommand = new RelayCommand(GetUTXO, () => !IsReceiving);
35-
MakeTxCommand = new BindableCommand(MakeTx, CanMakeTx);
35+
MakeTxCommand = new RelayCommand(MakeTx, CanMakeTx);
3636
CopyTxCommand = new RelayCommand(CopyTx, () => !string.IsNullOrEmpty(RawTx));
3737
ShowQrWindowCommand = new RelayCommand(ShowQrWindow, () => !string.IsNullOrEmpty(RawTx));
3838
ShowJsonWindowCommand = new RelayCommand(ShowJsonWindow, () => !string.IsNullOrEmpty(RawTx));
@@ -301,13 +301,10 @@ private async void GetUTXO()
301301
/// <summary>
302302
/// Creates the Raw Unsigned Transaction.
303303
/// </summary>
304-
public BindableCommand MakeTxCommand { get; private set; }
305-
private void MakeTx(object param)
304+
public RelayCommand MakeTxCommand { get; private set; }
305+
private void MakeTx()
306306
{
307-
// param is of type System.Windows.Controls.SelectedItemCollection
308-
IList utxo = (IList)param;
309-
310-
var tx = txBuilder.Build(TxVersion, utxo.Cast<UTXO>().ToList(), ReceiveList.ToList(), LockTime);
307+
var tx = txBuilder.Build(TxVersion, SelectedUTXOs.Cast<UTXO>().ToList(), ReceiveList.ToList(), LockTime);
311308
RawTx = tx.Serialize().ToBase16();
312309
}
313310
private bool CanMakeTx()

CommonLibrary/InpcBase.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using System.Collections.Generic;
1+
// Bitcoin Transaction Tool
2+
// Copyright (c) 2017 Coding Enthusiast
3+
// Distributed under the MIT software license, see the accompanying
4+
// file LICENCE or http://www.opensource.org/licenses/mit-license.php.
5+
6+
using System.Collections.Generic;
27
using System.ComponentModel;
38
using System.Reflection;
49
using System.Runtime.CompilerServices;

CommonLibrary/RelayCommand.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
using System;
1+
// Bitcoin Transaction Tool
2+
// Copyright (c) 2017 Coding Enthusiast
3+
// Distributed under the MIT software license, see the accompanying
4+
// file LICENCE or http://www.opensource.org/licenses/mit-license.php.
5+
6+
using System;
27
using System.Windows.Input;
38

49
namespace CommonLibrary

CommonLibrary/ViewModelBase.cs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
1-
namespace CommonLibrary
1+
// Bitcoin Transaction Tool
2+
// Copyright (c) 2017 Coding Enthusiast
3+
// Distributed under the MIT software license, see the accompanying
4+
// file LICENCE or http://www.opensource.org/licenses/mit-license.php.
5+
6+
namespace CommonLibrary
27
{
38
public class ViewModelBase : InpcBase
49
{
510
/// <summary>
611
/// Used for changing the visibility of error message TextBox.
712
/// </summary>
8-
public bool IsErrorMsgVisible
9-
{
10-
get { return isErrorMsgVisible; }
11-
private set { SetField(ref isErrorMsgVisible, value); }
12-
}
13-
private bool isErrorMsgVisible;
13+
[DependsOnProperty(nameof(Errors))]
14+
public bool IsErrorMsgVisible => !string.IsNullOrEmpty(Errors);
1415

1516
/// <summary>
1617
/// String containing all the errors.
1718
/// </summary>
1819
public string Errors
1920
{
20-
get { return errors; }
21-
set
22-
{
23-
if (SetField(ref errors, value))
24-
{
25-
IsErrorMsgVisible = !string.IsNullOrEmpty(value);
26-
}
27-
}
21+
get => _errors;
22+
set => SetField(ref _errors, value);
2823
}
29-
private string errors;
24+
private string _errors;
3025

3126
/// <summary>
3227
/// Status, showing current action being performed.
3328
/// </summary>
3429
public string Status
3530
{
36-
get { return status; }
37-
set { SetField(ref status, value); }
31+
get { return _status; }
32+
set { SetField(ref _status, value); }
3833
}
39-
private string status;
34+
private string _status;
4035

4136
}
4237
}

0 commit comments

Comments
 (0)