none
Custom UserControl Class indicated at other project file RRS feed

  • Question

  • hey there, Microsoft
    by default when creating a UserControl - it are presented with a default code page

    UserControl1.xaml
    -- UserControl1.xaml.vb
    MyFile.vb

    there are a different logic path being thought and the requirement is to  have the xaml control class happening in other file MyFile.vb

    -- default attached file class --
    
    x:Class="UserControl1"
    
    -- wondering requirements --
    
    x:Class="MyFileNamespace.UserControl1"
    the issue is that the UserControl are not rendered - the result in window is only the namespace text show "MyFileNamespace.UserControl1";
    and so instead the control are not displayed;

    EDIT:: the happening are not very clear on what is going on, since the default attached file where filled with only a empty UserControl1 class which had being created at the custom path;

    EDIT2:: just like when searching for Local Functions, Visual Basic goes with wild names like Lambda Expressions, thus perhaps to figure out something alike is to be known to proper indicating the Custom Path for the UserControl Class by some weird name;


    Thursday, August 1, 2019 8:12 PM

All replies

  • There is a special forum for XAML programming (WPF)

    https://social.msdn.microsoft.com/forums/vstudio/en-us/home?forum=wpf


    Success
    Cor

    Friday, August 2, 2019 1:29 AM
  • Hi,

    1.Import a local namespace in XAML:

    <Window x:Class="WpfApp1.MainWindow"
            xmlns:local="clr-namespace:WpfApp1"
      
            Title="MainWindow" Height="450" Width="800">
        <Grid>
            <local:UserControl1 ></local:UserControl1>
        </Grid>
    </Window>

    2.Import third-party namespaces in XAML

    <Window x:Class="WpfApp1.MainWindow" 
            xmlns:myToolTip="clr-namespace:WpfControlLibrary1;assembly=WpfControlLibrary1"
            Title="MainWindow" Height="450" Width="800">
        <Grid>
            <myToolTip:UserControl1 ></myToolTip:UserControl1>
        </Grid>
    </Window>

    Best Regards,

    Alex



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 6, 2019 3:11 AM