dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.22k stars 1.75k forks source link

Upgrading to Visual Studio 17.5 broke MAUI Windows Slider #13917

Closed vsfeedback closed 1 year ago

vsfeedback commented 1 year ago

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version] [regression] [worked-in:17.4.4] Upgrading the Visual Studio 17.5 caused some minor spacing and alignment to change in my .net MAUI app deployed to windows and also broke our slider in the application.

Steps to reproduce

  1. Create a MAUI .net Application
  2. Create a ViewModel for the slider with the following properties
    • public double SliderPercentage { get; set; }
    • public ICommand DragStartedCommand { get; }
    • public ICommand DragCompletedCommand { get; }
      • The commands do not have to do anything
  3. Set the view model as the binding context for the page and pass the view model to the page somehow.
  4. Create an svg file called scrollable_icon.svg in the resources/Images folder for the thumb image. Change the build action to MAUI image. The file contains (this site doesn't accept svg files as attachments):
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="747.000000pt" height="716.000000pt" viewBox="0 0 747.000000 716.000000" preserveAspectRatio="xMidYMid meet">
  <g transform="translate(0.000000,716.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none">
    <path d="M1820 7023 c-94 -16 -203 -66 -264 -122 -15 -14 -116 -158 -224 -320 -245 -370 -277 -412 -427 -576 -115 -125 -129 -143 -159 -202 -54 -107 -56 -132 -56 -585 0 -468 -1 -460 70 -521 79 -67 97 -70 459 -76 l325 -6 29 -50 c99 -168 295 -291 537 -336 105 -20 310 -15 417 9 225 51 412 175 501 333 l27 49 730 0 730 0 23 -44 c58 -108 190 -221 332 -282 123 -53 242 -77 395 -77 191 0 316 28 466 104 122 63 241 177 278 267 l13 30 266 4 c299 5 326 10 402 75 71 61 70 53 70 515 0 397 -1 413 -21 455 -24 50 -82 103 -147 133 -30 15 -161 42 -386 81 -384 66 -396 69 -486 114 -114 57 -122 66 -708 730 -172 195 -206 222 -348 272 l-79 28 -1370 1 c-753 1 -1381 0 -1395 -3z m765 -678 l0 -410 -425 -3 c-464 -3 -515 1 -550 45 -34 44 -47 7 177 503 41 91 82 173 92 184 24 27 99 68 150 82 32 9 124 12 301 11 l255 -2 0 -410z m1860 391 c123 -48 112 -36 546 -555 142 -170 153 -195 102 -228 -25 -17 -90 -18 -1040 -21 l-1013 -2 0 415 0 416 678 -3 c638 -3 680 -4 727 -22z m-2007 -1693 c241 -60 326 -289 161 -437 -158 -143 -466 -139 -614 9 -132 132 -89 308 98 400 111 54 218 63 355 28z m2955 6 c202 -39 321 -222 241 -369 -109 -201 -478 -242 -663 -74 -153 137 -95 344 119 425 96 36 184 41 303 18z" />
    <path d="M370 3445 l0 -745 3200 0 3200 0 0 745 0 745 -3200 0 -3200 0 0 -745z" />
    <path d="M3583 304 c-13 -32 -10 -221 4 -235 20 -20 28 16 28 128 0 67 -4 106 -12 114 -10 10 -14 8 -20 -7z" />
  </g>
</svg>
  1. Add a slider to the MAUI app with the following attributes and bindings and surrounding Grid:
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="100" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="100" />
    </Grid.ColumnDefinitions>

    <Slider x:Name="Slider" 
            ThumbImageSource="scrollable_icon.png"
            MinimumTrackColor="Red"
            MaximumTrackColor="Green"
            Value="{Binding SliderPercentage}"
            DragStartedCommand="{Binding DragStartedCommand}"
            DragCompletedCommand="{Binding DragCompletedCommand}"
            Minimum="0"
            Maximum="1"
            Margin="20,0"
            Grid.Column="0"
            Grid.ColumnSpan="3"/>

</Grid>
  1. Run the application on Windows 10 Home 22H2

Expected behaviour The slider can move from the beginning to the end when the user drags it back and forth Actual Behaviour The slider gets stuck at about one third of the way across and does not move after that


Original Comments

Feedback Bot on 3/1/2023, 05:51 PM:

(private comment, text removed)


Original Solutions

(no solutions)

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

RohitYeast commented 1 year ago

@samhouts I have re-updated my Visual Studio to 17.5.2 and could not reproduce this problem at that version. The original issue was found running my Maui App on windows through Visual Studio version 17.5.1. Does this resolve the issue?

samhouts commented 1 year ago

Duplicate of #13061