locked
[UWP] - Mouseover in Popup is extended RRS feed

  • Question

  • Hi, 

    I work on Universal App to windows 10.

    I need to change color of mouseover in mouseover when this is extended.

    I try design in Blend but, the Blend not help me, not design any style for popup :(

    someone help me?

    Thanks

    Monday, August 3, 2015 12:16 PM

Answers

  •  Hello fipcurren,

    >>I need to change color of mouseover in mouseover when this is extended. I try design in Blend but, the Blend not help me, not design any style for popup :(

    I feel a bit confused about which exact element you want to change its color, for a muserover? Based my experience, the mouseover sounds like an event name which does not contain color property.

    Or if I understand correctly, what you want to do is when the mouse is over the popup, you want to change the color of the popup.

    If so, in windows universal development, you could use the PointerEntered and PinterExited events and here I made a demo:

    The XMAL:

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    
            <StackPanel>
    
                <Button Content="OpenPopup" Click="Button_Click"></Button>
    
                <Button Content="ClosePopup" Click="Button_Click_1"></Button>
    
                <Popup Name="MyPopup" Width="600" Height="400" >
    
                    <Grid Name="MyGrid" Width="600" Height="400" Background="Orange" PointerEntered="MyPopup_PointerEntered" PointerExited="MyPopup_PointerExited">
    
                    <!--add elements here-->
    
                    </Grid>
    
                </Popup>
    
            </StackPanel>
    
        </Grid>

    The .cs code:

    public sealed partial class MainPage : Page
    
        {
    
            public MainPage()
    
            {
    
                this.InitializeComponent();
    
            }
    
    
            private void Button_Click(object sender, RoutedEventArgs e)
    
            {
    
                this.MyPopup.IsOpen = true;
    
            }
    
    
            private void Button_Click_1(object sender, RoutedEventArgs e)
    
            {
    
                this.MyPopup.IsOpen = false;
    
            }
    
    
            private void MyPopup_PointerEntered(object sender, PointerRoutedEventArgs e)
    
            {
    
                this.MyGrid.Background = new SolidColorBrush(Colors.Gray);
    
            }
    
    
            private void MyPopup_PointerExited(object sender, PointerRoutedEventArgs e)
    
            {
    
                this.MyGrid.Background = new SolidColorBrush(Colors.Orange);
    
            }
    
        }

    If I do not understand correctly, please feel free to let me know and please provide a clear clarification about what you want to do.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    Tuesday, August 4, 2015 7:05 AM