小编Ati*_*eer的帖子

UserControl元素由于其保护级别而无法访问

我正在写一个Windows Phone 8.1应用程序(WinRT).

我的用户控件:XAML:

<UserControl x:Name="LoadingProgressBarPage"
x:Class="Project1.Custom.General.UserControls.LoadingOverlayFullScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Merakyahoga.com.Custom.General.UserControls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"

Foreground="{x:Null}"
d:DesignHeight="800" d:DesignWidth="480" >

<Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
        <RowDefinition Height="1*"/>
        <RowDefinition Height="1*"/>
        <RowDefinition Height="1*"/>
    </Grid.RowDefinitions>
    <StackPanel 
        Name="LayoutRoot_StackPanelMain"
        Grid.Row="1"
                Orientation="Vertical">
        <ProgressBar Name="ProgressBar" 
                     IsIndeterminate="True"
                     Foreground="{StaticResource DefaultTheme_DarkBlueColor}" 

                     Height="50" 
                     Width="480" 
                     VerticalAlignment="Center"/>

        <StackPanel Name="LayoutRoot_SubStackPanel"
                    Orientation="Horizontal"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center">

            <Image Name="ImageHolder_Main"
                   Width="54">    
            </Image>

            <TextBlock Name="ProgressBarText"
                   Text="Please Wait.." 
                       Margin="10,0,0,0"
                   FontWeight="Normal"
                   HorizontalAlignment="Center"
                       FontSize="18"
                       Foreground="{StaticResource DefaultTheme_DarkBlueColor}" VerticalAlignment="Center"/>

        </StackPanel>

    </StackPanel>
</Grid>
Run Code Online (Sandbox Code Playgroud)

CS:

namespace Project1.Custom.General.UserControls
{
    public partial class LoadingOverlayFullScreen : UserControl
    {


        public LoadingOverlayFullScreen()      
        {
            InitializeComponent()

            //WINRT: …
Run Code Online (Sandbox Code Playgroud)

c# xaml user-controls access-modifiers windows-phone-8.1

7
推荐指数
1
解决办法
3879
查看次数