WinUI-Gallery icon indicating copy to clipboard operation
WinUI-Gallery copied to clipboard

Use Selectorbar for Sample Code

Open ghost1372 opened this issue 1 year ago • 14 comments

related to #1535

Full Code (Xaml/C#)

00002

Single Code (Xaml Only)

00001

Description

Motivation and Context

How Has This Been Tested?

Tested on my Laptop

Screenshots (if appropriate):

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

ghost1372 avatar May 18 '24 10:05 ghost1372

Does this solve #704?

Jay-o-Way avatar May 18 '24 16:05 Jay-o-Way

Does this solve #704?

No. we need to disable horizontal scroll

ghost1372 avatar May 18 '24 16:05 ghost1372

Thank you for creating this PR!

I think porting the SwitchPresenter control over just for this is a bit overkill, this problem can also be solved with a bit of code-behind. Also, given that people also use this app's source code for reference, introducing a new control just for this doesn't seem like the best idea.

I saw that the gallery uses some communitytoolkit Nuget packages. For a simple control, I did not use the community Nuget package, which has a larger size... That's why I copied their codes.

ghost1372 avatar May 18 '24 18:05 ghost1372

We are in fact using Community Toolkit packages, that is correct. I would argue though, in this case, porting a complete control for something one could do with a few lines of code behind is overkill.

marcelwgn avatar May 19 '24 08:05 marcelwgn

We are in fact using Community Toolkit packages, that is correct. I would argue though, in this case, porting a complete control for something one could do with a few lines of code behind is overkill.

ok, what do you suggest? Changing visibility? Frame?

ghost1372 avatar May 19 '24 10:05 ghost1372

ok, what do you suggest? Changing visibility? Frame?

I would probably use a ContentPresenter and have that switch the content

marcelwgn avatar May 19 '24 11:05 marcelwgn

@marcelwgn I saw your last message late, I sent 2 commits, First by changing the visibility and lastly the suggestion you gave.

ghost1372 avatar May 19 '24 11:05 ghost1372

For some reason - for some controls, the content is empty. image image

Jay-o-Way avatar May 19 '24 21:05 Jay-o-Way

For some reason - for some controls, the content is empty. image image

hmm... it seems that XamlSource is just a file path, so content will be updated later after reading file.

ghost1372 avatar May 19 '24 21:05 ghost1372

@Jay-o-Way i reverted last commit (ContentPresenter) now everything is working fine

ghost1372 avatar May 19 '24 21:05 ghost1372

Does this solve #704?

No. we need to disable horizontal scroll

For me, this pr currently actually does disable horizontal movement when using the scroll wheel hovering this area. 🥳 @karkarl

Jay-o-Way avatar May 20 '24 00:05 Jay-o-Way

Does this solve #704?

No. we need to disable horizontal scroll

For me, this pr currently actually does disable horizontal movement when using the scroll wheel hovering this area. 🥳 @karkarl

I'm ok disabling horizontal scroll. It annoys me a lot too :P

karkarl avatar May 20 '24 17:05 karkarl

Question: I see muxc:Expander is used, but do we still need the muxc part? One more detail please? Removing this margin/padding would be pretty. image

Jay-o-Way avatar May 20 '24 17:05 Jay-o-Way

Does this solve #704?

No. we need to disable horizontal scroll

For me, this pr currently actually does disable horizontal movement when using the scroll wheel hovering this area. 🥳 @karkarl

I'm ok disabling horizontal scroll. It annoys me a lot too :P

done

ghost1372 avatar May 21 '24 08:05 ghost1372

Hold on, I see a little misunderstanding here. The issue in 704 was: When scrolling (vertically) across a page, coming over a code example gives an unwanted horizontal scrolling. This PR already solved that. The last commit makes it impossible to scroll horizontally. Please revert.

Done

ghost1372 avatar May 21 '24 11:05 ghost1372

I think we'd want to horizontally align the XAML / C# SelectorBar with the XAML?

Done image

ghost1372 avatar Jun 12 '24 13:06 ghost1372

/azp run

karkarl avatar Jun 12 '24 17:06 karkarl