Giter Club home page Giter Club logo

wpfui's People

Contributors

a3305 avatar aelarion avatar aybex avatar chucker avatar dependabot[bot] avatar ivandmitriev1 avatar jackbonadies avatar jannesstroehlein avatar jbryknar avatar jeremywu917 avatar jz5 avatar kevfrench avatar koal44 avatar makesyt avatar nice3point avatar niels9001 avatar nirmal2506 avatar parzivalexe avatar pomianowski avatar redstripes89 avatar ricaun avatar seasonyuu avatar syntax-tm avatar tmijail avatar trungnt2910 avatar u-c-s avatar vukovinski avatar walterlv avatar wherewhere avatar xmine64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wpfui's Issues

Move fonts to separate package?

Is your feature request related to a problem? Please describe.
I noticed the file size of WPFUI.dll is over 3MB. It seems 2.64MB of that is from the included TTF fonts.

Describe the solution you'd like
Move the fonts into a separate Nuget package, that you can include only if you need to use them.

Describe alternatives you've considered
Removing the fonts completely?

Thank you for an otherwise great library. :)

Controls like DataGrid or DatePicker are not styled

First of all, congratulations, styles looks really slick!

Is there a plan to support styling in more controls out of the box? I'm thinking about more complex controls like DataGrid or DatePicker (Calendar).

NavigationItem Image property not working

Describe the bug
For store navigation, setting Image property on an NavigationItem has no effect.

To Reproduce
Steps to reproduce the behavior:

  1. Set Image on a navigation item
  2. Use navigation item in store navigation
  3. Image does not appear

Expected behavior
Setting Image property should work :)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win 11
  • .NET: net5.0
  • Version: 1.2.2-prerelease111

Additional context
Add any other context about the problem here.

Refactoring

Hi, sorry if this is a silly question, but I'm trying to port Navigation into a project on Net Framework 4.8. I'm using vs2022 and resharper, not sure what it's about, but I see a lot of warnings like:

"CS8603 Possible null reference return."
"CS8625 Cannot convert null literal to non-nullable reference type."
etc...
it looks very like some of the code needs refactoring, is this true or am I missing something?

And one more thing, it looks like some of the Handlers won't be able to be compiled on nf4.8. Because they require version C# 9.0 or later. So I'm not sure if the library is ready to run on older versions of .net

Allow window dragging when maximized (from title bar)

This is a standard feature in windows app.
Main window should be able to be moved when it's maximized as a standard Windows application.
When the drag starts, the window should automaticaly return to its last "normal" size.

What is the radiograph sample?

Describe the bug
It's not a bug report, just a question. In the screenshots, there is a radiograph sample. But I don't see any trace of it in the code.

Is it a mistake or a sample to come?

I take the opportunity to thank you about your work. There is work to do to refine some styles, but I do like the simplicity of the code compared to other repos with lot of stuff (too much in my opinion).

Support for watermark hinting in the TextBox control

What I'm referring to is a wantermark hint for textbox controls like (eg: Search apps, games, movies and more):

image

Most likely this would have to be implemented as a custom control called like wpfui:TextBox/ as along with modifying the control template, there would also be a need to add a dependency property such as WatermarkHint. As a temporary solution, I could add this control functionality myself in my projects, but it would be really nice as a standard feature in this library.

.NET Framework 4.7.2 support?

I've only skimmed the code so far; is there any need to target 4.8 rather than 4.7.2? I find that a lot more users have 4.7.2 installed than 4.8.

UiWindow style not applying. TargetType error.

I am trying to use the 'UiWindow' Static Resource, but I am getting an error.
Error: 'Window' TargetType does not match the type of element 'Window'

To Reproduce
Steps to reproduce the behavior:

  1. Create a new WPF Window
  2. Apply the Style="{StaticResource UIWindow}" property.

Expected behavior
The windows' style to change to UiWindow.

Desktop

  • OS: Windows 10
  • .NET: net6.0-windows
  • Version: Stable 1.1.0 (Same error on the latest prerelease'39')

Confusing API: WPFUI.Background.Manager vs. WPFUI.Theme.Manager

I realize this may be a bit nitpicky and super broad, so feel free to close if this is considered non-actionable.

Context:
When trying to utilize the functionality of each of the Manager classes in WPFUI.Background and WPFUI.Theme I am finding myself getting confused quite often. Using intellisense as a crutch may be part of the problem, so no issue taking flak for that. However the current structure limits the ability to be clear when utilizing both types of managers, and also introduces a bit of ambiguity between the responsibilities of each manager.

Why it's confusing:
While I do understand the logical structure of these (e.g. Background.Manager refers more to the Win32 API and various window handle things, Theme.Manager strictly messes with styles and colors, but does occasionally touch some interop stuff), if you happen to need to touch each of these classes in a single class you really have to read the implementations to understand what you're looking for. I don't think Background captures the separation from Theme well enough given how much heavy lifting each of these managers are doing. Also, you are left with the option of basically not utilizing using statements for both WPFUI.Background and WPFUI.Theme, since you will get ambiguity errors and have to deconflict them anyway. This results in having to directly call which manager you need, which you may not specifically have memorized for what you're trying to do.

Inconsistent Public Methods:
There are further some publicly accessible method naming inconsistencies which don't help clarify things. For example, Theme.Manager uses a Switch verb to indicate we're changing a color scheme, but Background.Manager uses an Apply verb to indicate we're changing background effects. Both these effectively do the same thing -- they "change" value(s) from what is currently active to what we want to be active (with appropriate cleanup under the covers). To throw in some extra convolutions, we actually have Background.Manager.ApplyDarkMode and Background.Manager.RemoveDarkMode which are indirectly called by Theme.Manager.Switch. Part of the solution might be internalizing some stuff that isn't necessarily intended to be touched by the outside implementations -- I'm not familiar enough with these to know if that's feasible.

Possible fix:
I realize due to the complexity of these managers, this isn't something that could ever be done with a simple copy/paste or Ctrl+F replacements. However, I think perhaps instead of having "Background" and "Theme" being separate namespaces/directories, these could be combined under one larger namespace like WPFUI.WindowVisuals -- or something more generic. We could then have a BackgroundManager class and ThemeManager class in this namespace which clearly handle each of their respective duties. I realize this would require additional refactoring to avoid a monolithic and crowded namespace (e.g. for SystemManager and such) so we would obviously need to look at really planning out what makes sense.

Of course, I think whatever is chosen (if chosen to touch this) would likely have to be broken up into smaller, more manageable issues (e.g. "create ThemeManager class", "refactor ____ class", "remove ____ namespace", etc.).

DatePicker behaviour like in Office

Describe the bug
DatePicker should have the month / year active right away

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'WPFUI.Demo > Forms > DatePicker'
  2. Click on calendar next to the DatePicker control
  3. Click on month header
  4. Select month

Expected behavior
The month/year selector should work and be visible right away.
(Optionally, it should have its header like in Office)

Location
https://github.com/lepoco/wpfui/blob/main/WPFUI/Styles/Controls/Calendar.xaml

Pattern
https://developer.microsoft.com/en-us/fluentui#/controls/web/datepicker

Screenshots
Date picker dark
Date picker2

Desktop:

  • OS: Windows 11
  • .NET: net6.0-windows10.0.22000.0
  • Version: 1.1.1-prerelease49

Window Control Buttons Missing Icons

Describe the bug
The window control buttons do not display correctly in the demo application.

To Reproduce
Run the demo application and not the buttons on the far right of the title bar.

image

Expected behavior
Expected to see standard window control buttons like this:

image

Desktop (please complete the following information):

  • OS: Windows 10
  • .NET: 6.0.100
  • Version: 1.1.0

This could be caused by the missing Fonts folder (it's referenced in the project, but not included in the source control):

image

Change button name

Is your feature request related to a problem? Please describe.
I am frustrated that the button has always the name action, when i want to use it for a download to

Describe the solution you'd like
A method like SetLeftButtonName(string name) or a xaml property named LeftButtonName

When there is a way i dont know, please tell me

This is a very good ui framework

Navigation: Support to MVVM

Using MVVM pattern, the NavigationItem Type could be a page with an assigned DataContext, the viewmodel.
The NavigationToElement uses the Activator.CreateInstance(element.Type) creating the object and I haven't found a clean way to assign it the DataContext.

My solution currently is to modify the NavigateToElement assigning the DataContext.

private void NavigateToElement(INavigationItem element, bool refresh)
{
[...]

element.Instance = Activator.CreateInstance(element.Type);

var control = element as FrameworkElement;
var controlInstance = element.Instance as FrameworkElement;

if (controlInstance.DataContext == null)
controlInstance.DataContext = control.DataContext;

[...]
}

Alternative could be to find a way to pass parameters to the NavigationItem, to use in an Activator.CreateInstance with parameters.

HorizontalScrollbar broken and not working properly wit UiScrollViewer.

It seems like UiScrollViewer only works with VerticalScrollBar

To Reproduce

  1. Add a control like ScrollViewer or TextBox
  2. Set the style 'UiScrollViewer'
  3. Set HorizontalScrollViewer to 'Visible' or 'auto'
  4. See bug

Expected behavior
The horizontal scrollviewer should work as intended with the Fluent Style, but instead only shows the up/down repeat buttons of a vertical scrollbar.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • .NET: net6.0-windows
  • Version: 1.2.1

ListView support

The title says it all. It would be nice seeing a modern ListView control in this library.

Question: How can I access page controls from another page?

So, I'm using the navigation with a frame (like in the demo) but I don't quite understand how to access a controls that is located on another page? like I have two pages, HomePage and SecondPage, HomePage has a HomeCheckBox how to access this checkbox from SecondPage ๐Ÿค”

I don't use mvvm and maybe it's a dumb question. ๐Ÿ˜…

Toggle switch control change the color of the Button

Describe the bug

In my demo application I have ToggleSwitch control and a Button. When I change the ToggleSwitch state, the color of the Button also changed.

Screenshots

MainWindow.2022-02-18.20-30-42.mp4

Desktop

  • OS: Windows 10
  • .NET: net6.0-windows
  • Version: latest version from 18.02.2022, 353aae4

NavigationItem pin animation

Just tweaked NavigationItem #25

Now it is an exact copy Microsoft Store nav except for the pin animation. In XAML we can make two types of animation for forward and backward respectively, but we need something in the code to know which one to play.

Example
Animation

Demo

Is it possible to create release of the Demo, that i dont have to download this repo.

Split accent brushes

If we want to use a different accent color in the two themes, we need to separate the brushes.

https://github.com/lepoco/wpfui/blob/main/WPFUI/Styles/Assets/Brushes.xaml#L18

SystemAccentColorLight2 & SystemAccentColorDark2
etc..

I made some attempts and I did not like the result, the accent color is not like those used in windows 11 and it looks like some colors are mixed up. The right thing to do is to use an algorithm which will generate the necessary shades (SystemAccentColorLight and Dark 1-3) based on SystemAccentColor, but Microsoft has not yet shared the information on how they get these shades.

Icons in title bar appear wrong

Describe the bug
The icons in the title bar look incorrect

To Reproduce
Steps to reproduce the behavior:

  1. Install Windows 11
  2. Open app RadioGraph
  3. See error

Expected behavior
Icons look correct

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11
  • .NET: Net 6

Scroll bars do not appear for UiPageScrollable

Describe the bug
Scroll bars do not appear when UiPageScrollable style is set on Page

To Reproduce
Steps to reproduce the behavior:

  1. Open sample app.
  2. Scrollable pages do not have scrollbars visible.

Expected behavior
Scroll bars are visible.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win 11
  • .NET: .net5.0
  • Version: 1.2.2-prerelease111

Additional context
Add any other context about the problem here.

SearchBar

Is your feature request related to a problem? Please describe.
I'm wondering if a search-bar is a good addition to the WPFUI suit of controls?

Describe the solution you'd like
It should behave just like the search-bar in the Microsoft Store or in the Xbox app.

Describe alternatives you've considered
I've thought on editing a list box using styles and more, but I haven't succeed yet.

Additional context
image

Horizontal navigation

I tried to make a horizontal navigation style, but I hit a wall, no matter what I do the list is always vertical ๐Ÿค”.
Here is an example of what I am trying to achieve
image

Any ideas?

Navigation issue using when using mouse back button

Describe the bug
A clear and concise description of what the bug is.

Using Radiograph app:
When I click on a button to navigate to a page, and then use the back button on my mouse, the main panel seems to navigate back but the navbar doesn't update navigation and I can't click on any button again to renavigate unless I use the navbar to navigate back to the page I want.

To Reproduce
Steps to reproduce the behavior:

  1. Go to App
  2. Click on Monitoring page
  3. Use hardware back button (in my case my mouse side button)
  4. Notice the navigation occurs in the panel but not the navbar

Expected behavior
Expect navigation to be synced

Screenshots
If applicable, add screenshots to help explain your problem.
https://i.imgur.com/tI9HENR.png

Desktop (please complete the following information):

  • OS: [e.g. Windows 10] Windows 11
  • .NET: [e.g. net5.0-windows10.0.17763.0]
  • Version: [e.g. 1.0.4-prerelease45]

Additional context
Add any other context about the problem here.

MVVM support for Snackbar

It would be nice if there could be MVVM support for snackbars. One example of that is from MaterialDesignThemes' repo where they have implemented it nicely. Something similar would be great in my opinion.

Button doesn't have Appearance property

Describe the bug
I wanted to apply the secondary button style but then there was no Appearance property in WPFUI button.

Expected behavior
Appearance property to be there.

Desktop (please complete the following information):

  • OS: Windows 10
  • .NET: Framework 4.8
  • Version: 1.1.0

Additional context

Error
The property 'Appearance' does not exist in XML namespace 'clr-namespace:WPFUI.Controls;assembly=WPFUI'. 

ObservableCollection does not work correctly with the controls

If we try to add any control via code using ObservableCollection, we won't get the desired result.
for example:

public ObservableCollection<WPFUI.Controls.Card> TestColl { get; set; } = new ObservableCollection<WPFUI.Controls.Card>();

TestTest.Add(new WPFUI.Controls.Card {Content = "Test"});

The result will be just Test text without any style

Similar behavior can be seen in the Demo > Controls > DataGrid
data grid
As you see the checkboxes use the default windows style.

Maybe someone knows why this happens? I have not yet tested other ui libraries, wonder how they handle it.

Button in light mode has a faint color difference when hovering.

Describe the bug
Button in light mode has a faint color difference when hovering.

To Reproduce
Steps to reproduce the behavior:

  1. Create app with WPFUI
  2. Add a button and load the light mode xaml
  3. See bug.

Expected behavior
Button to have more color difference when hovering.

Screenshots
Normal state:
image
Hovering:
image

Desktop (please complete the following information):

  • OS: Windows 11
  • .NET: Framework 4.8
  • Version: 1.2.1

Color Issues in Light Theme

Describe the bug
Many controls need to be tweaked in the Light Theme due to the fact that the default theme is black.

Dialog has no EventHandler for Left button.

Describe the bug
Dialog has EventHandler for ButtonRightClick but not for ButtonLeftClick

Additional context
As I mentioned here, their event handler code for the buttons is different, yes they are different controls, but the purpose of the buttons is the same in both controls - one for action the other for cancel.

CardAction control causes cursor "flicker" when clicking

Describe the bug
The CardAction control reverts to an Arrow style cursor when the left mouse button is pressed on the control. This causes a "flicker" effect on the user's cursor when clicked without holding the button down.

To Reproduce
Steps to reproduce the behavior:

  1. Place cursor over a CardAction control.
  2. Click control with left mouse button.
  3. Observe that while mouse button is pressed, cursor changes from Hand to Arrow style.

Expected behavior
The cursor should stay as a Hand while the left mouse button is pressed.

Screenshots
card-action-flicker

OS/Version Information

  • Windows 10
  • .NET Framework 4.7.2
  • WPFUI 1.2.1.0 (via NuGet)

Feature request: Modal Window

I propose to create a control that is called a Modal Window, the content of which will be in the form of a page.

image_2022-02-17_172438

After pressing the button, we show the modal window which is located in MainWindow (IsOpen = true;) and define its content, for example as it is done with navigation Type="{x:Type pages:Page1}"

What do you think about this? I can create the xaml part but the navigation part is a bit complicated for me ๐Ÿ˜…

Port to avalonia

I really like the look of this theme but I use avalonia for most of my projects would you be happy for me to port this to avalonia? I would adhere to the rules of the license and credit you and this repo

White board around the window when the "SizeToContent" Window property is used

Describe the bug

When the property

<Window
    ...
    SizeToContent="WidthAndHeight">

is used the application window has the white board on the bottom and on the right.

To Reproduce

Run the simplest application described in the README.md

Expected behavior

Window should be all black

Screenshots

image

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • .NET: [e.g. net6.0-windows]

Double-click sometimes incorrectly maximizes the application

Describe the bug
Sometimes when you trigger the maximizing by double-clicking on the TitleBar, the application is immediately maximized and restored.

To Reproduce

  1. Open one or two demo app's
  2. Several times maximize and restore using double-click / dragging from maximized window
  3. See error

Expected behavior
Double click always maximizes the application from its normal state.

Screenshots

Animation

Desktop:

  • OS: Windows 11 Education 22000.1.amd64fre.co_release.210604-1628
  • .NET: 6.0.101
  • Version: 1.2.2-prerelease133

Additional context
#36
/ Multimonitor setup - 3440x1440 (125%) [Landscape] + 1080x1920 (125%) [Portrait]

WPFUI.Theme.Manager.SetSystemTheme() throws System.NullReferenceException

Describe the bug
If the project has any ResourceDictionaries in the App.xaml that do not have the 'Source' property set, the above exception is being thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Add a Resource dictionary to a demo/test project without the 'Source' property set.
  2. Run it.

Expected behavior
The Switch Method should ignore the Resource Dictionaries that do not have the 'Source' property set.

Additional context
Tinkered a little with the code and adding a null check on the Switch Method of the Manager fixed this.
Basically applicationDictionaries[i].Source != null

WinUI 3 Feedback

Honestly it's a good idea, but if you want to rewrite winui3 to wpf then do it right.

  1. Use the official color palette.
  2. Use the official control design. (you can find Figma toolkit and or xaml files in winui repo

and people will be to contribute :)

Theme.Watcher.cs - System theme does not update reliably

Describe the issue

Theme.Watcher.cs: subscribing to the SystemParameters.StaticPropertyChanged is an unreliable way to keep the styling up to date with the system theme as the event will only fire once after the first time the system color theme is changed, but no longer after that (adding to this, the properties SystemParameters.UxThemeColor and SystemParameters.UxThemeName never change).

Suggested implementation

It feels a bit hacky, as WPF is generally supposed to abstract away from Win32, but I've created a working implementation in my SystemThemeWatcher.cs (view on PasteBin). Basically, you'd initialize it in your application's MainWindow.SourceInitialized event like SystemThemeWatcher.Start(this). It'll create a hook, monitoring messages sent to the window from the system, looking for WM_SETTINGCHANGE, then calling Manager.SetSystemTheme() to update the theme accordingly.

For some context I've added using aliases to Theme.Manager -> ThemeManager and Background.Manager -> BackgroundManager so I can reference either without namespace conflicts.

Desktop (please complete the following information):

  • OS: Windows 10
  • .NET: net6.0-windows
  • Version: 1.2.2-prerelease136

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.