none
Finde nicht warum er ein Cntrol nicht findet. XamlNavigation in VB.Net RRS feed

  • Frage

  • Ich versuche gerade das Microsoft Windows Universal Sample XamlNavigation in VB.NET umzusetzen.

    Ich finde Partou nicht warum er im Control nicht den Titlebar finden will. In anderen Klassen findet er auch teilweise die Controls in den xaml Seiten nicht. Woran kann das liegen?

    Imports System
    Imports System.Collections.Generic
    Imports System.IO
    Imports System.Linq
    Imports System.Runtime.InteropServices.WindowsRuntime
    Imports Test.Views
    Imports Windows.Foundation
    Imports Windows.Foundation.Collections
    Imports Windows.UI.Xaml
    Imports Windows.UI.Xaml.Controls
    Imports Windows.UI.Xaml.Controls.Primitives
    Imports Windows.UI.Xaml.Data
    Imports Windows.UI.Xaml.Input
    Imports Windows.UI.Xaml.Media
    Imports Windows.UI.Xaml.Navigation
    Namespace Test.Controls
        Public NotInheritable Class PageHeader
            Inherits UserControl
            Public Sub New()
                '  Me.InitializeComponent()
                AddHandler Loaded, Function(s, a)
                                       AddHandler AppShell.Current.TogglePaneButtonRectChanged, AddressOf Current_TogglePaneButtonSizeChanged
                                       Me.titleBar.Margin = New Thickness(AppShell.Current.TogglePaneButtonRect.Right, 0, 0, 0)
                                   End Function
            End Sub

            Private Sub Current_TogglePaneButtonSizeChanged(sender As AppShell, e As Rect)
                Me.titleBar.Margin = New Thickness(e.Right, 0, 0, 0)

            End Sub

    'titlebar' ist kein Member von Pageheader

    ---------------------------

    <UserControl
        x:Name="Root"
        x:Class="Test.Controls.PageHeader"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        VerticalAlignment="Top"
        VerticalContentAlignment="Top"
        HorizontalAlignment="Stretch"
        HorizontalContentAlignment="Stretch"
        Height="48"
        mc:Ignorable="d"
        d:DesignHeight="300"
        d:DesignWidth="400">
        <Grid x:Name="grid" Background="{x:Bind Background}">
            <Grid x:Name="titleBar">
                <ContentPresenter x:Name="content"
                                  VerticalAlignment="{x:Bind VerticalContentAlignment}"
                                  HorizontalAlignment="{x:Bind HorizontalContentAlignment}"
                                  Margin="{x:Bind Padding}"
                                  Content="{x:Bind HeaderContent}"/>
            </Grid>
        </Grid>
    </UserControl>

    Sonntag, 12. März 2017 19:11

Antworten

Alle Antworten