maui
maui copied to clipboard
[WinUI] Problems while using `RefreshView`
Description
I have problems to get the RefreshView
control working on WinUI. I'm not able to click content which is nested in the RefreshView
. Also, I cannot trigger the pull to refresh function.
The XAML code for the screenshot above:
<!-- Main Content -->
<Grid
RowSpacing="0"
RowDefinitions="Auto,*,Auto"
>
<!-- Header -->
<StackLayout
Padding="16,8"
Spacing="0"
CompressedLayout.IsHeadless="true"
>
<!-- Title -->
<Label
Margin="16,8"
FontFamily="{StaticResource MontserratSemiBold}"
Text="{x:Static localization:Strings.HeadlineOverview}"
TextColor="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray100}}"
HorizontalTextAlignment="Start"
Style="{StaticResource HeadlineLabelStyle}"
/>
<BoxView />
</StackLayout>
<!-- KlipperState -->
<RefreshView
Grid.Row="1"
IsRefreshing="{Binding IsRefreshing}"
Command="{Binding RefreshPageCommand}"
>
<ScrollView>
<StackLayout
Style="{StaticResource ModalInputPageStackLayoutStyle}"
>
<!-- ... -->
</StackLayout>
</ScrollView>
</RefreshView>
<!-- Tag line -->
<StackLayout
IsVisible="{Binding IsPrinterOnline, Converter={StaticResource BooleanReverseVisibilityConverter}}"
Grid.Row="2"
BackgroundColor="{AppThemeBinding Light={StaticResource Gray100}, Dark={StaticResource Gray900}}"
>
<BoxView />
<Button
Margin="20,6,20,4"
Command="{Binding RestartServiceCommand}"
CommandParameter="firmware"
Text="{x:Static localization:Strings.ButtonRestartFirmware}"
Style="{StaticResource RoundedLongButtonStyle}"
/>
<Button
Margin="20,4,20,20"
Command="{Binding RestartServiceCommand}"
CommandParameter="klipper"
Text="{x:Static localization:Strings.ButtonRestartKlipper}"
Style="{StaticResource RoundedLongButtonStyle}"
/>
</StackLayout>
</Grid>
public Command RefreshPageCommand { get; set; }
bool RefreshPageCommand_CanExcecute()
{
return !IsRefreshing;
}
async Task RefreshPageAction()
{
try
{
IsRefreshing = true;
List<Task> tasks = new()
{
KlipperClient.Instance.RefreshPrintStatusAsync(),
KlipperClient.Instance.RefreshVirtualSdCardStatusAsync(),
KlipperClient.Instance.RefreshPrinterInfoAsync(),
};
await Task.WhenAll(tasks);
KlipperState = KlipperClient.Instance.KlipperState;
IsPrinterOnline = KlipperState == "ready";
if (IsPrinterOnline)
{
CachedTemperatures = await KlipperClient.Instance.GetServerCachedTemperatureDataAsync();
UpdateTemperatureHistory();
}
}
catch (Exception exc)
{
// Log error
EventManager.Instance.LogError(exc);
}
IsRefreshing = false;
}
Steps to Reproduce
- Create a
RefreshView
and run the app on Windows
Version with bug
6.0.408 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
windows10.0.19041.0
Did you find any workaround?
No response
Relevant log output
No response
Hi @AndreasReitberger. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi, I created a repro. https://github.com/AndreasReitberger/MauiRefreshViewRepro
- Run on Windows
- Click on "Open Modal",
- Try to click the "Click me" button
After 10 seconds it works. This is the time spent on the "RefreshCommand". I guess that the problem is, that the Refresh animation is not shown at all. Hope this helps!
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on windows platform with sample project.
https://github.com/AndreasReitberger/MauiRefreshViewRepro
Still an issue as of 8.0-preview6. The swipe to pull-to-refresh was temporarily resolved as of preview3, but another solution will be necessary, as this breaks this Windows design guidelines.
Still an issue as of 8.0-preview6. The swipe to pull-to-refresh was temporarily resolved as of preview3, but another solution will be necessary, as this breaks this Windows design guidelines.
RefreshContainer works only with touch, the recommendation working with mouse is to also have a refresh button. Feedback?, could we do something else at RefreshView level?
@jsuarezruiz The real bug here appears to be that the RefreshView blocks all controls inside it. You can't click on buttons or anything anymore.