C#/WPF
-
[WPF]LoadingSpinnerC#/WPF 2023. 6. 13. 09:39
Using GIF image as animation: You can also use a GIF image as a loading indicator in your project. The WPF does not support animating the GIF image as default, if you try to use it just like JPG or PNG image, it will not animate. Fortunately, there is a NuGet package called WpfAnimatedGif which can animate the GIF images. Let’s see how to make use of it. First of all, install WpfAnimatedGif, for..
-
[WPF] ShellExecuteC#/WPF 2023. 6. 9. 08:40
[DllImport("shell32")] private static extern IntPtr ShellExecute(IntPtr windowHandle, string operation, string filePath, string parameter, string directoryPath, int command); ShellExecute(IntPtr.Zero, "open", Path.GetFullPath("RobotAsset.xgwx"), null, null, 4);
-
[WPF] PlatformC#/WPF 2023. 6. 7. 14:28
https://learn.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2022 How to: Configure projects to target platforms - Visual Studio (Windows) Learn how Visual Studio enables you to set up your applications to target different platforms, including the Arm64 platform. learn.microsoft.com
-
[WPF] PostBuildEventC#/WPF 2023. 6. 1. 14:10
이렇게 PostBuildEvent 두번 설정하면 마지막 PostBuildEvent만 실행 됨. 하나의 에 묶어서 넣어야 함. 특정 모드시에만 동작Condition으로 조건 달아줌. https://learn.microsoft.com/ko-kr/visualstudio/ide/how-to-specify-build-events-csharp?view=vs-2022 빌드 이벤트 지정(C#) - Visual Studio (Windows)Visual Studio에서 빌드 이벤트를 사용하여 빌드 시작 전, 또는 빌드 완료 후 C# 프로그램을 위한 실행되는 명령을 지정할 수 있습니다.learn.microsoft.com https://stackoverflow.com/questions/150053/how-to-..
-
[WPF] Find ParentC#/WPF 2023. 5. 31. 16:56
private static T FindParent(DependencyObject child, string parentName) where T : DependencyObject { if (child == null) return null; T foundParent = null; var currentParent = VisualTreeHelper.GetParent(child); do { var frameworkElement = currentParent as FrameworkElement; if(frameworkElement.Name == parentName && frameworkElement is T) { foundParent = (T) currentParent; break; } currentParent = V..
-
[WPF] EventHandlerC#/WPF 2023. 5. 31. 16:31
https://yangbengdictionary.tistory.com/11 [C#] EventHandler - 이벤트에 특정값(Class)전달 EvenHandler 일반적인 EventHander는 이벤트 발생시 전달할 값이 없는 이벤트를 나타냅니다. public delegate void EventHandler(object? sender, EventArgs arg); 매개 변수 Sender => Object 이벤트 호출자, 이벤트 소스라 불 yangbengdictionary.tistory.com
-
[WPF] Access view control from viewmodelC#/WPF 2023. 5. 31. 16:19
public interface IView { void AddTextBoxToGrid(); } 2) Inherit code behind View from your IView and implement IView.AddTextboxToGrid() method public partial class View: IView { public void AddTextBoxToGrid() { // implement here your custom view logic using standard code behind; } } 3) Add a property of type IView to your VM public class ViewModel { public IView View { get; set; } } 4) Set View p..
-
[WPF] ReadOnly PropertyC#/WPF 2023. 5. 24. 10:48
[ReadOnly(true)] public class AddDeviceProperty { // 속성창에 표시되는 항목들 [ReadOnly(true)] public string Image { get; set; } [ReadOnly(true)] public string Name { get; set; } [ReadOnly(true)] public string Base { get; set; } [ReadOnly(true)] public string Slot { get; set; } [ReadOnly(true)] public string Description { get; set; } [ReadOnly(true)] public string Notes { get; set; } }