Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown upon hovering / pressing a GridSplitter, when its background isn't a SolidColorBrush #2262

Closed
ravindUwU opened this issue Jun 21, 2018 · 0 comments

Comments

@ravindUwU
Copy link
Contributor

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

When the background of a GridSplitter is assigned to a Brush that isn't a SolidColorBrush, a COMException is thrown upon hovering it:

System.Runtime.InteropServices.COMException (0x800F1000): No installed components were detected.

Cannot resolve TargetProperty (Grid.Background).(SolidColorBrush.Color) on specified object.
    at Windows.UI.Xaml.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
    at Microsoft.Toolkit.Uwp.UI.Controls.GridSplitter.GridSplitter_PointerEntered(Object sender, PointerRoutedEventArgs e)}

HResult -2146496512

Message "No installed components were detected. Cannot resolve TargetProperty (Grid.Background).(SolidColorBrush.Color) on specified object."

This occurs due to the "PointerOver" VisualState at: https://github.com/Microsoft/WindowsCommunityToolkit/blob/28577f08fc606a9d02bdc757f058de99c90c8aa7/Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter/GridSplitter.xaml#L22-L37 where the background is assumed to be a SolidColorBrush, whose color is animated. The "Pressed" VisualState would presumably throw an analogous exception.

Expected behavior

The background of the GridSplitter changes to the specified Brush.

Minimal reproduction of the problem with instructions

<Page ...
    xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls">
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <toolkit:GridSplitter Grid.Column="1" HorizontalAlignment="Left">
        <toolkit:GridSplitter.Background>
            <!-- Assign something other than a SolidColorBrush (e.g. LinearGradientBrush, ImageBrush, etc.) -->
            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                <GradientStop Color="Black" />
                <GradientStop Offset="1" Color="White" />
            </LinearGradientBrush>
        </toolkit:GridSplitter.Background>
    </toolkit:GridSplitter>
</Grid>

Upon running the app and hovering over the GridSplitter, the app crashes with the exception detailed under "Current Behaviour".

Environment

Nuget Package(s):
    Microsoft.Toolkit.Uwp.UI.Controls

Package Version(s): 
    3.0.0

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: Community 2017 15.4.1)
- [ ] 2017 Preview (version: )
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant