-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(Expander): improve Expander #1478
Changes from 1 commit
d0b1bde
40440a6
a19d2d5
a825943
2497acb
0b611fe
b859dc9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,6 +336,17 @@ | |
<Setter Target="PART_RootGrid.Background" Value="Transparent" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState x:Name="OverlayVisible"> | ||
<VisualState.Setters> | ||
<Setter Target="PART_MainContent.Visibility" Value="Visible" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState x:Name="OverlayHidden"> | ||
<VisualState.Setters> | ||
<Setter Target="PART_MainContent" Value="Visible" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replace the setters with this. you were missing the Visibility property :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OMG. That makes sense. Thanks, I will fix that. |
||
<Setter Target="PART_ContentOverlay" Value="Visible" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
|
||
<VisualStateGroup x:Name="ExpandDirectionStates"> | ||
|
@@ -431,6 +442,14 @@ | |
HorizontalContentAlignment="Stretch" | ||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" | ||
Visibility="Collapsed" /> | ||
|
||
<ContentControl Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="2" | ||
x:Name="PART_ContentOverlay" | ||
Canvas.ZIndex="10" | ||
Content="{TemplateBinding ContentOverlay}" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
Visibility="Collapsed" /> | ||
</Grid> | ||
</Grid> | ||
</ControlTemplate> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// ****************************************************************** | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// This code is licensed under the MIT License (MIT). | ||
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH | ||
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE. | ||
// ****************************************************************** | ||
|
||
namespace Microsoft.Toolkit.Uwp.UI.Controls | ||
{ | ||
/// <summary> | ||
/// Display mode of the Expander that will update the behavior of the content visibility | ||
/// </summary> | ||
public enum ExpanderDisplayMode | ||
{ | ||
/// <summary> | ||
/// Default mode (the content is totally collapsed) | ||
/// </summary> | ||
Expand, | ||
|
||
/// <summary> | ||
/// Overlay mode (only the overlay content is visible) | ||
/// </summary> | ||
Overlay | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
public UIElement ContentOverlay
{
get { return (UIElement)GetValue(ContentOverlayProperty); }
set { SetValue(ContentOverlayProperty, value); }
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worry. I tried with object to see if it worked better.