Hi all of you,
I've got a class with one property but it is not visible from my view and have not idea why...main problem here I got a couple of errors:
"Instance coud not created BotoEspecial"
And then:
"PropertyMetadata is already registered for BotoEspecial type"
My Vb class:
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Imports System.Windows.Controls.PrimitivesPublic Class BotoEspecial Inherits ButtonBase
Public Sub New() DefaultStyleKeyProperty.OverrideMetadata(GetType(BotoEspecial), New FrameworkPropertyMetadata(GetType(BotoEspecial))) End Sub
Public Property IconImage() As BitmapImage Get Return DirectCast(GetValue(IconImageProperty), BitmapImage) End Get Set(value As BitmapImage) SetValue(IconImageProperty, value) End Set End Property Public Shared ReadOnly IconImageProperty As DependencyProperty = _ DependencyProperty.Register("IconImage", GetType(BitmapImage), GetType(BotoEspecial), New UIPropertyMetadata(Nothing)) End Class
My whole view (window):
<Window x:Class="SeleccionMarca" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:GIT_CuadroMando" Title="SeleccionMarca" Height="345.802" Width="753.435"><Grid Margin="0,0,2,-3"><StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="10,10,10,0" Height="299"/><local:BotoEspecial.IconImage></local:BotoEspecial.IconImage><BitmapImage UriSource="/Imagenes/Logos Marcas/BMW_31.jpg"/></local:BotoEspecial.IconImage></Grid></Window>
Thanks in advance for any hint,
Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF and SilverLight stuff