Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86c73cc
commit 692d04e
Showing
14 changed files
with
276 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<Window x:Class="ProtoPad_Client.PromptIPAddressWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:ProtoPad_Client" | ||
Title="PromptIPAddressWindow" Height="128" Width="220"> | ||
<Grid> | ||
<Grid.Resources> | ||
|
||
<src:CheckFilledConverter x:Key="TestConverter" /> | ||
|
||
</Grid.Resources> | ||
|
||
<Button Content="Cancel" HorizontalAlignment="Left" Margin="10,66,0,0" VerticalAlignment="Top" Width="75" IsCancel="True"/> | ||
<Button Content="OK" HorizontalAlignment="Left" Margin="127,66,0,0" VerticalAlignment="Top" Width="75" IsDefault="True"> | ||
<Button.IsEnabled> | ||
|
||
<MultiBinding Converter="{StaticResource TestConverter}"> | ||
|
||
<Binding ElementName="IPAddressTextBox" Path="Text" /> | ||
|
||
<Binding ElementName="PortTextBox" Path="Text" /> | ||
|
||
</MultiBinding> | ||
|
||
</Button.IsEnabled> | ||
</Button> | ||
<TextBox x:Name="IPAddressTextBox" HorizontalAlignment="Left" Height="23" Margin="87,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="115"/> | ||
<TextBox x:Name="PortTextBox" HorizontalAlignment="Left" Height="23" Margin="87,38,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="115"/> | ||
<Label Content="IP address:" HorizontalAlignment="Left" Margin="10,6,0,0" VerticalAlignment="Top"/> | ||
<Label Content="Port:" HorizontalAlignment="Left" Margin="10,34,0,0" VerticalAlignment="Top"/> | ||
|
||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
|
||
namespace ProtoPad_Client | ||
{ | ||
public partial class PromptIPAddressWindow | ||
{ | ||
public static readonly DependencyProperty IPAddressProperty = DependencyProperty.Register("Text", typeof(String), typeof(TextBox), new FrameworkPropertyMetadata("")); | ||
public string IPAddress | ||
{ | ||
get { return Convert.ToString(GetValue(IPAddressProperty)); } | ||
set { SetValue(IPAddressProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty PortProperty = DependencyProperty.Register("Text", typeof(String), typeof(TextBox), new FrameworkPropertyMetadata("")); | ||
public int Port | ||
{ | ||
get { return int.Parse(Convert.ToString(GetValue(PortProperty))); } | ||
set { SetValue(PortProperty, value); } | ||
} | ||
|
||
public PromptIPAddressWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
|
||
public class CheckFilledConverter: IMultiValueConverter | ||
{ | ||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return values.All(v => (v is string) && (!String.IsNullOrWhiteSpace(v.ToString()))); | ||
} | ||
|
||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.