UserControl: Use of Custom Control and Events --> XamlParseException (was unhandled)
I have the following UserControl in which I am using some custom controls (UiNumericTextBox - based off of TextBox). When I tried to set the TextChanged property on the UiNumericTextBox, I get the XamlParseException and this Inner Exception:
{"'OnTextChanged' value cannot be assigned to property 'TextChanged' of object 'ACPUi.UiNumericTextBox'. Error binding to target method. Error at object 'ACPUi.UiNumericTextBox'."}
I decided to try using a different custom control (UiButton) and that worked fine. I did not receive any issues. I also tried using the standard controls (TextBox) and that worked fine as well. I'm using the June CTP release.
Here's the XAML for my UserControl and the dummy event methods. Thanks in advance for your assistance.
<
UserControlx:Class="ACPUi.UiIPAddress"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:ACPUiNS="clr-namespace:ACPUi"><
Grid><
Grid.ColumnDefinitions><
ColumnDefinitionWidth="Auto"/><
ColumnDefinitionWidth="Auto"/><
ColumnDefinitionWidth="Auto"/><
ColumnDefinitionWidth="Auto"/></
Grid.ColumnDefinitions><
ACPUiNS:UiNumericTextBoxTextChanged="OnTextChanged"x:Name="IPAddressOctet1"Grid.Row="0"Grid.Column="0"Width="32"Height="22">0</ACPUiNS:UiNumericTextBox><
TextBoxTextChanged="OnTextChanged"Name="IPAddressOctet2"Grid.Row="0"Grid.Column="1"Width="32"Height="22">0</TextBox><
TextBoxTextChanged="OnTextChanged"Name="IPAddressOctet3"Grid.Row="0"Grid.Column="2"Width="32"Height="22">0</TextBox><
TextBoxTextChanged="OnTextChanged"Name="IPAddressOctet4"Grid.Row="0"Grid.Column="3"Width="32"Height="22">0</TextBox><
ACPUiNS:UiButtonClick="OnClick"Grid.Row="0"Grid.Column="0">First</ACPUiNS:UiButton></
Grid></
UserControl>publicvoid OnTextChanged(object sender,RoutedEventArgs e)
{
MessageBox.Show("UiIPAddress:OnTextChanged()");}
publicvoid OnClick(object sender,RoutedEventArgs e)
{
MessageBox.Show("UiIPAddress:OnClick()");
}

