I have a UserControl:

<UserControl x:Class="WP8.Progress"
    ..................................
    d:DesignHeight="800" d:DesignWidth="480">
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Rectangle Stretch="Fill" Opacity="0.75" Fill="DarkGray"/>
        <StackPanel x:Name="stackPanel" Orientation="Vertical" VerticalAlignment="Center">
            <ProgressBar Foreground="Blue" IsIndeterminate="True"/>
        </StackPanel>
    </Grid>
</UserControl>

I call UserControl in MainPage:

<phone:PhoneApplicationPage
    x:Class="WP8.MainPage"
    ..................................
    mc:Ignorable="d"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <Grid x:Name="LayoutRoot" Background="Black">
        <Grid>
            <Button Name="btnButton" Content="OK" Click="btnButton_Click"/>
        </Grid>
        <Grid>
            <uc:Progress />
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>

When i run app, i see UserControl upper MainPage but i still pressed button at MainPage. How do i only action at UserControl?

没有正确的解决方案

其他提示

I got your question i have done the same thing in my App when you are opening the UserControl set your LayoutRoot.IsHitTestVisible="False" and after then the user has done on the usercontrol or usercontrol is closed then set it as true. And you can also do some opacity or visibility changes if you want with the grid.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top