Coder Social home page Coder Social logo

ghost1372 / handycontrols Goto Github PK

View Code? Open in Web Editor NEW
1.0K 24.0 98.0 68.67 MB

Contains some simple and commonly used WPF controls based on HandyControl

Home Page: https://ghost1372.github.io/

License: MIT License

C# 99.64% PowerShell 0.28% HLSL 0.07% Python 0.02%
wpf styled-components style theme components wpf-ui mvvm xaml wpf-controls persian

handycontrols's Introduction

Hi There 👋 I'm Mahdi Hosseini from 🔥 IRAN/Persia 🔥

🔥🚀 I’m Developing Windows Apps with WindowsAppSDK/WinUI 3/WPF 🚀🔥
🧑‍🏫 I’m a Teacher in Primary School 🧑‍🏫


🌟 Support My Work! 🌟

Important

🌟 I pour my heart and soul into creating useful apps and tools. If you’ve found my work helpful or interesting, consider supporting me by making a donation. 🌟

Trust Wallet Address
Bitcoin bc1qzs4kt4aeqym6gsde669g5rksv4swjhzjqqp23a
ETH 0x40Db4476c1D498b167f76A2c7ED9D45b65eb5d0C

Tip

You can find My apps in the Microsoft Store


alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text


Mahdi's github streak



Mahdi's github trophy

handycontrols's People

Contributors

afunc233 avatar alphanecron avatar asine avatar cuiliang avatar danwalmsley avatar dingpingzhang avatar dinochan avatar gf-huang avatar ghost1372 avatar github-actions[bot] avatar guanguanchuangyu avatar imba-tjd avatar imgbotapp avatar jeremywu917 avatar keytrap-x86 avatar kleinpan avatar lindexi avatar lwqwag avatar m0n7y5 avatar mmasdivins avatar musashi-miyamoto avatar nabian avatar noctwolf avatar seedtyx avatar symbai avatar walterlv avatar xsnakes avatar yanchao891012 avatar yxhq avatar zdendaki 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

handycontrols's Issues

[Feature request] windows 11 context menu entries support

windows 11 context menu integration methods
Right now, the shell!/context menu command that we add by handycontrols, are shown in a new "show more options" menu of windows 11 context menu.
It would be great to have an option to avoid that.

we can check if windows os is 11, and then add entries in windows 11 fashion else same as before

Page XAML Designer doesn't load

Describe the bug

I'm trying to edit a xaml Page but the designer doesn't load the view.
all i can see is a (Very small) dot at the middle of the screen.

I added the DesignTimeResources.xaml for the itellisense as mentioned in the documentation. (also edited the .csproj and reloaded it)

i dont know if i'm doing something wrong but this issue slows down a bit my development.
What i'm doing right know is: creating a temporary user control and copy and paste the xml..

To Reproduce
Simply add to a wpf project (with HandyControls, obv) a Page (for a NavigationWindow)

Screenshots
image

This is my XAML Designer

and my code is

`

<Grid>
    <TextBlock Text="Test" 
               VerticalAlignment="Center"
               HorizontalAlignment="Center"
               FontSize="30"
               Foreground="White"/>
</Grid>

`

Class:

namespace Tengu.Classes.View { /// <summary> /// Logica di interazione per HomePage.xaml /// </summary> public partial class HomePage : Page { public HomePage() { InitializeComponent(); } } }

Environment (please complete the following information):

  • .Net core 5.0
  • IDE Visual Studio 2k19
  • HandyControls Version 3.3.5

I apologize in case i made a mistake in creating the report.
i love this library a lot!!

Difference between Loading and LoadingIndicator controls?

As I looking deeper in this amazing WPF toolkit, I don't understand why there is Loading and LoadingIndicator controls ? They seem to be overlapping a little bit each other.

I would say that Loading is the recommanded control as we find it in the Extended Controls page in the documentation site whereas LoadingIndicator documentation page is inside PersianToolkit area.

Would you give me some light on it?

TR Language Support

I translate for Turkish language support.
Please, I would be glad if you add it.

Russian localization

Hello!
You can add Russian localization?
I can send for you edited file with translated messages.

New release?

We are in the final stage of developing our new software using HandyControls. Currently we are using HandyControls v3.3.7 but we would benefit a lot of the new features (Mainly the Spanish translations but also the new "DataGrid.Small" and some bugfixes with the TextBox component error validation.)

Any possibility in having a new release?
I've tried using the MyGet builds but they seem a little unstable and crash or fail.

btw: thanks for contributing to such amazing library <3 Love it

Using both (Persian and Gregorian) calendars in single control and custom month names for PersianCalendar

  1. Would be very nice if the PersianCalendar control would be able to render both Gregorian and Persian calendars based on may be a DependencyProperty like IsGregorian? That would be great for multi-culture applications.
  2. Custom month names for Persian calendar would be very useful. for example if I need to use "Dari" month names like (حمل) instead of (فروردین) and (ثور) instead of (اردیبهشت).
    Thanks

Context menu is not in english

Describe the bug
TabControl has a default context menu which is not in English as declared default.

To Reproduce

  • Add HandyControls as NuGet package without specifying a language pack
  • Instantiate a TabControl with a TabItem
  • Richt-click on the tab header
  • Here you can see a menu which is not in the default language

Expected behavior
I expected to see a context menu with commmands in english

Screenshots
immagine

Environment (please complete the following information):

  • .net 5
  • Visual Studio 2019
  • HandyControls 3.2.0

Provide a Demo App

Please provide a demo app so we can experiment what's possible and what component library have in a demo app.

SimpleText control bug

Problem
Problem is in SimpleText control.
When you changing Foreground property it simply not changes the color of the text.
(I use the latest version of HandyControls on NuGet)

Localization

@GF-Huang
Unfortunately, the alternative I found was also limited, so I decided to Improve the previous localization which I had removed.
Finally, after a few hours, I succeeded, activating the design mode.😁
If you agree, I will return this version again
11

WpfApp12.zip

[Feature request] Global Data helper, if the path doesn't exist, create it.

Is your feature request related to a problem? Please describe.
currently, I have to manually create the path first before using a custom name with the path that might not exist already.

Describe the solution you'd like

public override string FileName { get; set; } =
         Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),"foo","bar","AppConfig.json");

if the above folders. foo & bar does not exist, Data helper should create them, before creating AppConfig.json.

Additional context
This method might come in handy

public static void CreateFile(string fullFilePath)
        {
            var fileName = Path.GetFileName(fullFilePath);
            var pathWithoutFileName = fullFilePath.Replace(fileName, "");
            Directory.CreateDirectory(pathWithoutFileName);
            if (string.IsNullOrEmpty(fileName))
				fileName = "AppConfig.json";
            File.Create(Path.Combine(pathWithoutFileName, fileName));
        }

Context Menu Items is invisible

I created a context menu.
Added some MenuItem to it (with headers) and launched my app.
The menu has items, but they are invisible(or text invisible)
Then I tried to add SimpleText as Item and I had the same result.
(I added items to menu programmatically)

How Can i apply custom styles in HandyControls

Hi,

I am using HandyControls in my WPF application. Since I need to add my custom style in the textbox. However, if I add my style in the textbox it overrides the HandyControls styles and it won't work as expected. Please let me know how to derive (BasedOn) HandyControl styles in my custom styles

Issue:
"Infoelement placeholder" didn't work If I add my custom style in the textbox.

Style

<Window.Resources>        
      <Style x:Key="NormalTextBoxStyle" TargetType="{x:Type TextBox}">
       <Style.Resources>
           <Style TargetType="{x:Type Border}">
               <Setter Property="Height" Value="30" />
               <Setter Property="Width" Value="300" />
               <Setter Property="Padding" Value="5 4 0 0" />
               <Setter Property="HorizontalAlignment" Value="Left" />
           </Style>
       </Style.Resources>
   </Style>
  </Window.Resources>

XAML

 <hc:TextBox Name="Name"
                 Grid.Row="5"
                 Grid.Column="1"
                 Margin="5 0 0 0"
                 Style="{StaticResource NormalTextBoxStyle}"
                hc:InfoElement.Placeholder="Please enter the name"
                 HorizontalAlignment="Left" 
                 Focusable="True"></hc:TextBox>

Environment (please complete the following information):

  • .net: [4.5.2]
  • IDE [e.g. vs2019]
  • Version [e.g. 16.7.7]

Thanks

Language Binding does not update when value of binded property changes

Describe the bug
I have used the following way to bind my label

<Label BorderThickness="0" Content="{ex:Lang Key={Binding AppStatus}}"/>

I have the following keys in my Lang.resx = "Idle", "Searching"
whose values are also defined.
Now the Initial value of AppStatus is set to "Idle"
and it shows and changes as I change language, but when I change the value of AppStatus to something else, say
AppStatus = "Searching"
I expected the value on the UI to change as well(to display the localized value of 'Searching'), but it stays on "Idle".

To Reproduce
Steps to reproduce the behavior:

  1. Bind any control with {ex:Lang Key={Binding BindingProperty}}
  2. Change the value of 'BindingProperty' to something else from the code
  3. The display value of the control doesn't change.

Expected behavior
When the value of BindedProperty is changed, I expected it would display the localized string of new value.

Environment (please complete the following information):

  • .net: 5.0
  • IDE vs2019
  • Version 3.3.7

Additional context
changing value from viewModel

The pop-up position of the ComboBox is offset

Describe the bug
The pop-up position of the combo box is offset, but in version 3.3.7 no problem

To Reproduce
Steps to reproduce the behavior:
None

Expected behavior
I expect position recover normal

Screenshots
Version 3.3.7:
image
Version 3.3.8:
image

Environment (please complete the following information):

  • .Net 5.0
  • Visual Studio 2019
  • HandyControls 3.3.8

Additional context
None

lost resource when referrence wfp project in a console app

Describe the bug
I referrenced a wfp project in a console app. calling Window.ShowDialog(). I'ok with official version of handyControl.
For example, add style ="{StaticResource ButtonPrimary}" to a button.
It's blue with handyControl, but white with handyControls.

To Reproduce
Steps to reproduce the behavior:

  1. Create a handyControls Project
  2. Add a button with style="{StaticResource ButtonPrimart}"
  3. Create a Console App
  4. Call MainWindow.ShowDialog() in Program.cs
  5. Run the Console App
  6. See.if the button is blue

Expected behavior
The button should be blue

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

Environment (please complete the following information):

  • .net: 4.8
  • IDE vs2019
  • Version 3.3.8.1

Additional context
Add any other context about the problem here.

How to set default selected sidemenuitem?

I would like the one sidemenuitem to be selected as default.
I just have 4 pages, I use sidemenu as navigation between these pages.
When I run my app none of sidemenuitems not selected. But I would like one to be.
I tried IsSelected property, but it works weird:
-As I start app everything is ok (it's selected)
-But when I click another sidemenuitem: there are two selected sidemenuitems.
image link

مشکل استروک در متن فارسی

یک مشکل در outline textbox وجود داره که زمانی که استروک به متن میدیم داخل متن هم میفته
image

البته در این عکس یه مشکل دیگه outline textbox هم وجود داره که متن فارسی رو برعکس میکنه و حتما باید flow driection چپ به راست بهش بدیم تا درست بشه

این دو مشکل در متن فارسی خیلی ازاردهندست و عملا نمیزاره ازش استفاده مفیدی بشه.

Set Language doesn't work on Persian Date Picker

Describe the bug
ConfigHelper.Instance.SetLang("en"); doesn't work on Persian Date Picker

Expected behavior
In official Date Picker SetLang method works and changes date picker language.

Environment (please complete the following information):

  • .net: 5
  • IDE: vs2022
  • Version 3.3.8

Custom treeviewitem foreground is not changed when is selected in treeview

I have an issue.
I created a custom treeviewitem content:

  • StackPanel
    • Image
    • SimpleText

By default the SimpleText foreground is black.
But when I choose that treeviewitem in a tree it's still black foreground.
How can I fix that?
Update: I found a selected event but how to update the color to black again when the node is unselected?
Update 2: I found an unselected event lol, now I have a problem: double click event on treeview not works anymore.
Update 3: i added DoubleClick event to treeviewitem instead, it works.

And now I have the same problem about the treeviewitem with the childs:
You can see my code for the changing colors of treeviewitem content:

item.Selected += delegate (object sender, RoutedEventArgs e) { lbl.Fill = new SolidColorBrush(Color.FromRgb(255, 255, 255)); };
item.Unselected += delegate (object sender, RoutedEventArgs e) { lbl.Fill = new SolidColorBrush(Color.FromRgb(0,0,0)); };
item.LostFocus += delegate (object sender, RoutedEventArgs e) { lbl.Fill = new SolidColorBrush(Color.FromRgb(0, 0, 0)); };

When the item is selected: item text color changed to white (gets blue bg)
When the item is unselected: item text changed to black (gets white bg)
When the item is lost focus: item text changed to black(gets gray bg)
Everything works well, but only with the treeviewitems that didn't have any children.
The items that contain some children are:

  • Getting white text color when its children are selected (But getting black text color when its children are lost focus)

Please fix that bug. I think the bug isn't in theme. It's in the events. Maybe a treeviewitem with children does wrong events?

All that i do right now is to handle a treeviewitem with an icon. Maybe there easier ways?

GlobalDataHelper.Load() throwing exception if AppConfig.json is empty.

Describe the bug
public static AppConfig Settings = GlobalDataHelper.Load();
Loading the JSON file throws an exception if the JSON file is empty, which though seems correct, but the way setting files are expected, maybe it could be made better

To Reproduce
Steps to reproduce the behavior:

  1. Clear the content of "AppConfig.json"
  2. Try to load it in code.

Expected behavior
If the config file is empty, it should be recreated, as is the case when the file doesn't exist.

Environment (please complete the following information):

  • .net: 5.0
  • IDE VS2019
  • Version 3.3.7

Additional context
My config file was empty because it was locked, which led to this exception as well.

Wrong code example in the documentation for the PasswordBox

Hello,

I noticed in your documentations, that in the "show password" section the ShowClearButton property is described, but the code example shows an example for the "ShowClearButton" property instead of the "ShowEyeButton" property.

Current Documentation

image

Suggested Documentation

image

Menustrip and DataGrid controls?

I didn't saw a menustrip, there is only a menustrip for window.
Also i didnt saw datagrid control to edit datatables like in Office 365 or other datatable editor apps.
I dont know something or its really missing?

Fix "NotifyIcon" control disappear of taskbar restart

Describe the bug
The notify icon disappear of taskbar restart

To Reproduce
Steps to reproduce the behavior:

  1. The open notify icon with application
  2. restart explorer.exe

Expected behavior
notify icon disappear

Screenshots
None

Environment (please complete the following information):

  • .NET 5.0
  • Visual Studio 2019
  • Version 3.3.8.1

Additional context
I tried to use "WM_TASKBARCREATED" message the solve issues

public sealed class TaskbarRebuildBehavior : Behavior<System.Windows.Window>
{
	#region --字段--
	public static readonly DependencyProperty ElementProperty = DependencyProperty.Register ("Element", typeof (UIElement), typeof (TaskbarRebuildBehavior));
	private int taskbarCreated;
	#endregion

	#region --属性--
	/// <summary>
	/// 获取或设置重建的元素
	/// </summary>
	public UIElement Element
	{
		get => (UIElement)this.GetValue (ElementProperty);
		set => this.SetValue (ElementProperty, value);
	}
	#endregion

	#region --公开方法--
	protected override void OnAttached ()
	{
		this.AssociatedObject.Loaded += (sender, e) =>
		{
			this.taskbarCreated = Win32_RegisterWindowMessage ("TaskbarCreated");
			if (PresentationSource.FromVisual (this.AssociatedObject) is HwndSource hwndSource)
			{
				hwndSource.AddHook (this.WndProc);
			}
		};
	}
	#endregion

	#region --私有方法--
	private IntPtr WndProc (IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
	{
		if (msg == this.taskbarCreated)
		{
			this.Element.Visibility = Visibility.Collapsed;
			this.Element.Visibility = Visibility.Visible;
		}
		return IntPtr.Zero;
	}
	#endregion

	#region --API--
	[DllImport ("user32.dll", EntryPoint = "RegisterWindowMessage", CharSet = CharSet.Unicode, SetLastError = true)]
	private static extern int Win32_RegisterWindowMessage (string lpString);
	#endregion
}

Growl icon does not display

Describe the bug

Growl.Success(new GrowlInfo {  
    Message = "..."
});

Expected behavior

image

Screenshots

image

Environment (please complete the following information):

  • .net: 5
  • IDE VS2019
  • Version 3.3.6-beta.19

[Feature request] Add a IValueConverter property to EnumBindingSourceExtension

Sometimes we need to binding the enum which defined in 3rd library or built-in .NET, so we can't add attributes to it.

Now, I use 2 converters to solves this issue when using ComboBox. If EnumBindingSourceExtension supports IValueConverter for each enum value, I can delete the CipherTypeArrayConverter and only use 1 converter.

image

image

Please read before creating Issue

Since this project is based on the official version and receives all its changes, in order to prevent code interference and rework, Please only mention issues related to the unofficial version here and Requests such as new language packs, bugs and new features should be listed on the official page.

Bug in Demo

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

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo
  2. Run debug

Expected behavior
Demo app stats to run

Screenshots
image

Environment (please complete the following information):

  • .net: 4.5
  • IDE vs2019 16.2.2

Additional context
I saw your latest commit 'fix demo', I pulled it but still the same error

date time picker

hi guys.
how can i call my windows default action or call a function, when user pressed Enter in a Date or Time picker.???

i add key pressed event to date picker, but it does not tack action!

thanks.

Default GlobalDataHelper config file should be created and used from only where the assembly(exe) is located

Describe the bug
When I run my application using cmd from any other path, the AppConfig.json is created at the directory where the cmd is currently opened (working directory).
I can get around it by defining a custom path for AppConfig though.
To Reproduce
Steps to reproduce the behavior:

  1. Open a command prompt at any location.
  2. Run the exe using the full path to exe.
  3. AppConfig.json will be created in the directory of step 1.

Expected behavior
The AppConfig.json should not be created at cmd working directory and must be used from where the exe is located.

Screenshots
image

Environment (please complete the following information):

  • .net: 5.0
  • IDE vs2019
  • Version 3.3.7

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.