wpf
32 TopicsWhat platform/technology/framework to use. I am lost. :-(
Hi everyone, I want to develop a new application that will run on Windows (desktop app) and android. I have about 30y of experience in development and the last 15 in C#/VS/.NET. At work we work with Winforms/WPF and .NET 4.8. For my personal new product I would like to start with all the latest and greatest but it's hard to find what to use. First of all I upgraded to VS 2022. I've been reading about .NET5/6, Xamarin, Xamarin Forms, .NET MAUI, Win UI, Winforms, WPF, UWP, Blazor, .NET Core, .NET Standard,.... but it's a mess to get an overview of what would fit best. The project would have 1 or 2 core assembly's with the logic and then a UI for Windows and one for Android. So before I start I would like to get an idea of what you would use. Thanks!Solved11KViews1like7CommentsWPF: Project doesn't find its own Classes ("tag not found in namespace")
Hi there, I've got a problem that's driving me crazy: c# WPF Custom Controls Project (NET 7), Base Namespace "UserControls". All the controls, styles and Converters existing in the project are in that namespace (I tripple checked, it's the only namespace used). All the controls and Converters are public classes. In the project, there is a Class named "EqualityToBooleanConverter.cs" Additionally, there is a Style file called Button.xaml. I need to use the aforementioned converter here, so I am referencing it like this: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:UserControls;assembly=UserControls"> <local:EqualityToBooleanConverter x:Key="ETBConverter" /> Intellisense does find the Namespace "UserControls", in fact, the namespace declaration AND the ressource declaration was done using intellisense. BUT as soon as I compile the project, the following error pops up: MC3074 - type "EqualityToBooleanConverter" does not exist in "clr-namespace:UserControls;assembly=UserControls" I just don't get it, as I said, all the files are in the same project, and they are - as of now - all using the root namespace "UserControls". Everything is fine until I start compiling. What I have tried so far: removing the "assembly"-part of the namespace-declaration changing the compile target from AnyCPU to x86 and back cleaning the solution creating a new solution, and re-adding all the files to it Also noteworthy: The same problem occurs when I try using one of the Usercontrols in that project WITHIN the project itself (like: creating a Window.xaml, defining the local-namespace, and trying to add the control leads to the same error as soon as I compile). I don't know what else could cause this...does anyone have any idea?4.4KViews2likes5Comments.NET MAUI WPF template not working
Hello. I had a problem with MAUI templates disappearing. It is not the first time it happens. I tried reinstalling several times even using the `InstallCleanup` utility from within VS Installer folder. Then I reinstalled VS Community 2022 and VS Community 2022 Preview. All the MAUI related features are checked yet I had no template. After following the instructions on [this page](https://github.com/dotnet/maui/issues/1473) I got templates (TLDR: I typed `dotnet new --install Microsoft.Maui.Templates` as suggested). 1st time I had only Blazor template and another displaying but after a further restart of VS they seem to appear all. So at this point templates seem to be present. When I create a new project I am told there are errors: NU1012 NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-android, net6.0-ios, net6.0-maccatalyst In solution explorer they seem to be present but Windows framework does not work. There are updates available but it won't install. NETSDK1147 Another error is NETSDK1147 To build this project, the following workloads must be installed: maui-android To install these workloads, run the following command: dotnet workload install maui-android Typing the command does not work neither dotnet workload install maui-android Failed to update the advertising manifest microsoft.net.sdk.macos: microsoft.net.sdk.macos.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Failed to update the advertising manifest microsoft.net.sdk.ios: microsoft.net.sdk.ios.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Failed to update the advertising manifest microsoft.net.sdk.tvos: microsoft.net.sdk.tvos.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Failed to update the advertising manifest microsoft.net.sdk.maccatalyst: microsoft.net.sdk.maccatalyst.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Failed to update the advertising manifest microsoft.net.workload.emscripten: microsoft.net.workload.emscripten.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Failed to update the advertising manifest microsoft.net.sdk.android: microsoft.net.sdk.android.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Failed to update the advertising manifest microsoft.net.workload.mono.toolchain: microsoft.net.workload.mono.toolchain.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Failed to update the advertising manifest microsoft.net.sdk.maui: microsoft.net.sdk.maui.manifest-6.0.300 is not found in NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".. Downloading Microsoft.Maui.Core.Ref.android.Msi.x64 (6.0.300-rc.1.5208) Downloading Microsoft.Maui.Core.Ref.android.Msi.x64 (6.0.300-rc.1.5208) Workload installation failed. Rolling back installed packs... Downloading Microsoft.Maui.Core.Ref.android.Msi.x64 (6.0.300-rc.1.5208) Installation rollback failed: One or more errors occurred. (microsoft.maui.core.ref.android.msi.x64::6.0.300-rc.1.5208 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".) Workload installation failed: One or more errors occurred. (microsoft.maui.core.ref.android.msi.x64::6.0.300-rc.1.5208 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\".) Description: Install one or more workloads. Usage: dotnet workload install [<WORKLOAD_ID>...] [options] Arguments: <WORKLOAD_ID> The NuGet package ID of the workload to install. Options: --configfile <FILE> The NuGet configuration file to use. -s, --source <SOURCE> The NuGet package source to use during the restore. To specify multiple sources, repeat the option. --skip-manifest-update Skip updating the workload manifests. --include-previews Allow prerelease workload manifests. --temp-dir <temp-dir> Specify a temporary directory for this command to download and extract NuGet packages (must be secure). --disable-parallel Prevent restoring multiple projects in parallel. --ignore-failed-sources Treat package source failures as warnings. --no-cache Do not cache packages and http requests. --interactive Allows the command to stop and wait for user input or action (for example to complete authentication). -v, --verbosity <LEVEL> Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. -?, -h, --help Show command line help. CS0103, CS0246 and XLS0414 Ultimately the source code is full of these errors CS0103 The name 'InitializeComponent' does not exist in the current context MauiApp1 (net6.0-android), MauiApp1 (net6.0-ios), MauiApp1 (net6.0-maccatalyst) CS0246 The type or namespace name 'ContentPage' could not be found (are you missing a using directive or an assembly reference?) MauiApp1 (net6.0-android), MauiApp1 (net6.0-ios), MauiApp1 (net6.0-maccatalyst) XLS0414 The type 'ContentPage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built I was experimenting with MAUI on a previous version. I know all these features are still under development. Referring to the 1st link I provide this issue already was and presumably an update fixed it yet the problem still exist. Any clue what I should do to make it work ? Best regards.3.9KViews0likes1Comment.NET MAUI How to receive process parameters
Hello everyone : When I was researching .NET MAUI, I didn't find an object that can receive process parameters, does anyone know? namespace AutoUpdate.WpfNet6_Sample { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { var args = e.Args; base.OnStartup(e); } } } For example, in wpf, you can get the parameters passed by the process through the args of Onstartup. How to get it in MAUI? like this? protected override Window CreateWindow(IActivationState activationState) { #if WINDOWS var state = activationState as ActivationState; var args1 = state.LaunchActivatedEventArgs; //var args = Environment.GetCommandLineArgs(); return new Window(new MainPage(args1.Arguments)); #endif return null; }2.4KViews0likes0CommentsHow to install MSIX application into subfolder in Start Menu
I have a WPF .NET 7 application that I am trying to install in a subfolder within the Start menu. I have found this article (https://learn.microsoft.com/en-us/windows/msix/packaging-tool/create-start-group) but it still just puts the application in the main (top) level. Below is my manifest code. Is there something I am missing? <?xml version="1.0" encoding="utf-8"?> <Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap uap3"> <Identity Name="b620b349-8f26-4acb-8e56-8ce628261ea2" Publisher="CN=Banner Engineering Corp., O=Banner Engineering Corp., S=Minnesota, C=US" Version="5.5.5.0" /> <Properties> <DisplayName>DXM Config V5_5</DisplayName> <PublisherDisplayName>cfoster</PublisherDisplayName> <Logo>Images\StoreLogo.png</Logo> </Properties> <Dependencies> <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" /> <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" /> </Dependencies> <Resources> <Resource Language="x-generate"/> </Resources> <Applications> <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$"> <uap3:VisualElements DisplayName="DXM Config V5_5" Description="DXM Configuration SW version 5.5" BackgroundColor="transparent" Square150x150Logo="Images\Square150x150Logo.png" Square44x44Logo="Images\Square44x44Logo.png" VisualGroup="SubGroup"> <uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/> <uap:SplashScreen Image="Images\SplashScreen.png" /> <uap:LockScreen BadgeLogo="Images\BadgeLogo.png" Notification="badge"/> </uap3:VisualElements> </Application> </Applications> <Capabilities> <Capability Name="internetClient" /> <rescap:Capability Name="runFullTrust" /> </Capabilities> </Package>1.9KViews0likes6Comments.NET 6 migration
Hi all, During migration of our existing project targeting .NET framework 4.8 we encountered starnge error: MC1000 Unknown build error, 'Could not find type 'System.Web.PreApplicationStartMethodAttribute' in assembly 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.5\ref\net6.0\System.Web.dll'.' Basically we have one big class library targeting net6.0-windows that has been used across multiple different smaller projects. This class library is compileable as a stanalone porject with no errors, but as soon as we reference it in our WPF project, also targeting same net6.0-windows, we got this error. Does anyone experiencing sme problem? Any help appreciated...1.7KViews0likes2CommentsWPF Application for sharing part of the screen with Teams works nice but menus are empty boxes
I've written a small application in WPF that shows 2 windows. One, which is basically a transparent window with no borders, for sharing a part of my screenin MS Teams and one with some resizing options. I have a very big screen on my PC and when I share my desktop I see all participants starting to move closer to their screen because the image is sized down to their screen and makes it very hard to read. I've seen several application solving this problem but most of them are a bit cumbersome. I'm a developer so I though: "I can do that too". Now when I share my partial window everything works fine but.... when I f.i. right click somewhere to call the context menu, I see the menu perfectly but on the shared screens a box with no content appears. This is probably a tough one but who can tell me what to do. Here's the mainpage.xaml: <Window x:Class="PartialShare.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="Partial Share (share this one)" x:Name="PartialShare" d:AllowsTransparency="true" mc:Ignorable="d" BorderThickness="1" BorderBrush="Blue" MaxHeight="{x:Static SystemParameters.MaximizedPrimaryScreenHeight}" Height="1000" Width="1000" ResizeMode="CanResizeWithGrip" Opacity="1" Topmost="true" AllowsTransparency="True" WindowStyle="None"> <WindowChrome.WindowChrome> <WindowChrome CaptionHeight="30" CornerRadius ="10" ResizeBorderThickness="20" GlassFrameThickness="0"> </WindowChrome> </WindowChrome.WindowChrome> <Window.Background> <SolidColorBrush Opacity="0.0" Color="Transparent" /> </Window.Background> </Window> The project is open source on GitHub. You can download it here: https://github.com/PaulSinnema/PartialShare1.7KViews0likes1CommentMAUI XAML "in-app toolbar" / "xaml inspector" no longer visible
Sorry for using some made up term but I have no idea what this little menu is called. So I referred to it as "xaml Inspector" I have 2 systems opening the same project, one is 17.3 preview 6 and the other is 17.3.2. On the preview version I can see this menu when I debug my MAUI app in Windows. I cannot see it on the 17.3.2 release, which seems to also be part of a wider debugging issue that I'm experiencing. Any idea how to fix this? Maybe I have changed a setting somewhere but am not aware of what. Thanks in advance!Solved1.6KViews1like2CommentsHow to retrieve a RegisterClassEx() form of standard VB controls suitable for use in C++ Application
How to make a RegisterClassEx() type from standard VB Controls (error control, progress bar, etc) suitable for use in C++ Applications? When you drag a VB control into a form, really .NET framework does a CreateWindowExW call to create it because the Win32 API what is really can create a control, .NET framework only adds a hidden API call, which is defined in the control and in System.Windows.Forms.dll (The control defines the class while System.Windows.Forms.dll calls CreateWindowExW on the specified class name) So, how to create a RegisterClassEx() type from standard VB controls suitable for use in Win32 C++ GUI Applications?1.2KViews0likes3Comments关于Microsoft Defender对VisualBasic.Net编写的软件报毒问题
大家好,我之前使用VS2019写过 VB.net 程序,该程序使用了Winform框架,除了导入了system.data.sqlite之外,其余任何组件都是使用的winform自带的组件,没有使用第三方库,并且仅仅只是一个数据库查询以及创建窗体的功能,将它编译好后,在打开时Microsoft Defender对其报毒(Trojan.xxx.A.xx)了,并且它不是每次打开都会报毒,是偶尔报一次毒,这对我的体验很不好,我无法找到它报毒的原因,请问这应该怎么解决?或者说我在写代码时应该注意什么以避免此问题。期待收到大家的回复,非常感谢923Views1like0Comments