-
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
Implement loading control with sample. #247
Conversation
Hi @dachibox, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@dachibox, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
Can you provide more information on what this Pull Request is including. You also need to resync with dev and resolve the conflicts. |
public sealed partial class Loading | ||
{ | ||
public static readonly DependencyProperty LoadingVerticalAlignmentProperty = DependencyProperty.Register( | ||
"LoadingVerticalAlignment", typeof(VerticalAlignment), typeof(Loading), new PropertyMetadata(default(VerticalAlignment))); |
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.
Use nameof() instead of strings for property names
Great @ScottIsAFool, let me revise all this and wait for a resync. Thanks'! |
We should think about this control in way that almost all waiting screen can be doable with it. Can I use it to display a fullscreen semi transparent rectangle with a waiting ring in the middle? I like the idea of this control but it has to be really versatile (and easy to use of course :)) |
@@ -277,7 +278,9 @@ | |||
<Content Include="Assets\Prettify\prettify.js" /> | |||
<Content Include="Assets\Prettify\run_prettify.js" /> | |||
<Content Include="SamplePages\RangeSelector\RangeSelectorCode.bind" /> | |||
<Content Include="SamplePages\AdaptiveGridView\AdaptiveGridViewCode.bind" /> | |||
<Content Include="SamplePages\AdaptiveGridView\AdaptiveGridViewCode.bind"> | |||
<SubType>Designer</SubType> |
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 is not true (As there are our binding commands inside)
@@ -292,6 +295,9 @@ | |||
<Content Include="SamplePages\BladeControl\BladeCode.bind" /> | |||
<Content Include="SamplePages\FadeHeader\FadeHeaderBehaviorCode.bind" /> | |||
<Content Include="SamplePages\FadeHeader\FadeHeaderBehaviorXaml.bind" /> | |||
<Content Include="SamplePages\Loading\LoadingCode.bind"> | |||
<SubType>Designer</SubType> |
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.
Shouldn't be designer here either
@deltakosh Yes of course, you can try the sample that exist on SampleApp. There you can change some properties and look and feel. The default template it's a must, so will start to finish this control with that. Thank's for all the help! |
@ScottIsAFool @deltakosh @dotMorten @pedrolamas I just updated the description and the project. Maybe now it's a little bit better :) Thank's! |
Conflicts: Microsoft.Toolkit.Uwp.UI.Controls/Themes/Generic.xaml
Conflicts: Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj Microsoft.Toolkit.Uwp.SampleApp/SamplePages/PrintHelper/PrintHelperPage.xaml.cs Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json
@skendrot I just updated this control with some improvements. Let see it all is in the right way. Thank's! |
Still many namespace changes to files not related to this PR. I do not disagree with the changes, but they should not be part of this PR. Can you please revert the files not associated with this PR. |
Conflicts: Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj Microsoft.Toolkit.Uwp.UI.Controls/Themes/Generic.xaml
@skendrot happy new year! :) This should almost be done now. Greetings! |
An example of how we can build the loading control. | ||
|
||
``` xaml | ||
<controls:Loading x:Name="LoadingControl" HorizontalAlignment="{Binding HorizontalAlignment.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.
Let's remove the alignment, background and opacity bindings for the documentation. Add in a binding for IsLoading
@@ -10,9 +10,9 @@ | |||
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE. | |||
// ****************************************************************** | |||
|
|||
using Microsoft.Windows.Toolkit.SampleApp.Models; |
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.
Revert this change
@@ -118,6 +118,14 @@ | |||
"BadgeUpdateVersionRequired": "/Assets/Badges/windows10_anniversary.png" | |||
}, | |||
{ | |||
"Name": "Loading", | |||
"Type": "LoadingPage", | |||
"About": "Loading control helps to show any xaml content with animation to the user while the app is doing some calculation.", |
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.
"LoadingControl helps to show content with animation to the user while the app is doing some calculation."
nameof(IsLoading), typeof(bool), typeof(Loading), new PropertyMetadata(default(bool), IsLoadingPropertyChanged)); | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether isLoading. |
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.
"Gets or sets a value indicating whether the control is in the loading state."
<Border x:Name="RootGrid" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" | ||
VerticalAlignment="{TemplateBinding VerticalAlignment}" | ||
Background="{TemplateBinding Background}" | ||
Opacity="{TemplateBinding Opacity}"> |
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 need to bind opacity
<Setter.Value> | ||
<ControlTemplate TargetType="controls:Loading"> | ||
<Border x:Name="RootGrid" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" | ||
VerticalAlignment="{TemplateBinding VerticalAlignment}" |
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 need to bind horizontal and vertical alignment. You should bind border properties like BorderBrush, BorderThinkness
<ContentControl x:Name="LoadingContentControl"/> | ||
</controls:Loading> | ||
``` | ||
- **HorizontalAlignment** and **VerticalAlignment** are responsible to align the custom content of the control. It aligns what we create inside as a ContentPresenter. |
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.
These can be removed. Nothing unique about these properties for this control
``` | ||
- **HorizontalAlignment** and **VerticalAlignment** are responsible to align the custom content of the control. It aligns what we create inside as a ContentPresenter. | ||
- **Background** and **Opacity** are for the panel who appears and disappears behind our custom control. | ||
- **ContentControl** could be everything done with xaml. For example: |
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.
Good to still show an example of putting content in the control, but no need to point out ContentControl. Perhaps "Use the LoadingControl to show specialized content"
Almost there!!! |
@skendrot so I hope that now is almost done 😅 |
@skendrot updated to the last upstream/dev |
WooHoo! Thanks for sticking with it @dachibox |
Hooray!! 😃 Thank you for staying with me all the time @skendrot and UWPCommunityToolkit Team!! |
@dachibox @deltakosh this is a progress overlay that can contain anything including progress bar / indicators / messages right ? Coding4Fun toolkit called it ProgressOverlay and should we stick with that name ? |
The control is thought for showing very simple the loading or progress status of the app. But yes, you can put anything you want in the control. I think that for messages, there is better with an MessageDialog or ContentDialog. What you think guys? @deltakosh @skendrot @hermitdave |
I would not rename it. If anything it would be good to merge with #828 to have a generic progress control that could have any content. If it was merged to one control then it would warrant being renamed. |
I agree that would be for the next phase though.. this looks good so I will merge it now |
@dachibox congratulations!! this along with #828 will be cool |
The loading control is for showing an animation with some content when the user should wait in some tasks of the app.
There is a sample on
Microsoft.Toolkit.Uwp.SampleApp/SamplePages
where we can change all the properties and content to see how easy it is.An example of how we can build the loading control.
Finally that the loading control appears, we must set the
IsLoading
property totrue
LoadingControl.IsLoading = true;