Florian Voß
Florian Voß
CC#
Created by Florian Voß on 1/26/2024 in #help
Popup doesn't pop up from Msal Login
No description
1 replies
CC#
Created by Florian Voß on 1/23/2024 in #help
Maui App looks different on different platforms
No description
7 replies
CC#
Created by Florian Voß on 1/15/2024 in #help
Pairing Visual Studio (Windows) to a Mac to build an app remotely on the Mac
When I try to connect my Visual Studio to a Mac device I get stuck on the display of the message from my screenshot. It says the XCode version on the MAC is not compatible with my Visual Studio so it cannot create the pairing. It prompts me to install version 14.2 of XCode instead of the currently installed 15.2 but I can't do so because the XCode version 14.2 is not compatible with the OS version on the Mac. So Instead I updated my Visual Studio, hoping that it becomes compatible with currently installed XCode version on the Mac, which leaded me to Build errors in Visual Studio that weren't there prior to updating Visual Studio: https://discord.com/channels/143867839282020352/1196477497542451280/1196477497542451280 Can you help me solving the Build errors in the other thread I just linked OR suggest me a different approach to make XCode and Visual Studio compatible?
6 replies
CC#
Created by Florian Voß on 1/15/2024 in #help
Build Errors after updating Visual Studio
No description
32 replies
CC#
Created by Florian Voß on 12/18/2023 in #help
Need help withDeployment / Publishing of .Net Maui App
No description
3 replies
CC#
Created by Florian Voß on 12/5/2023 in #help
Stuttering in UI and I don't know why
Everytime I launch the app, the very first time I navigate to any FlyoutItem I get this stuttering in UI. This happens everytime but always on first click only
4 replies
CC#
Created by Florian Voß on 12/5/2023 in #help
Issue with Filtering in DataGrid
No description
2 replies
CC#
Created by Florian Voß on 10/25/2023 in #help
❔ GridSplitter like in WPF but in Maui
in WPF there is a GridSplitter control. When using drag & drop on that control you can use it to resize Grid columns and rows around it. In Maui there is no GridSplitter control but I need one. The best thing I could find from googling "GridSplitter Maui" is this page https://learn.microsoft.com/en-us/dotnet/communitytoolkit/windows/sizers/gridsplitter. But there is only a communitytoolkit for UWP and WinUI applications, so that would only work in my windows build, but not in my android or ios build from my understanding. Can anyone help me to get a GridSplitter in my maui app that will work on all the platforms and not just one?
5 replies
CC#
Created by Florian Voß on 10/18/2023 in #help
❔ Need help on UI Design and tips for implementation - .Net Maui
No description
2 replies
CC#
Created by Florian Voß on 10/4/2023 in #help
❔ Exception Handling
I wonder whether I shall implement differentiated exception handling with detailed custom exceptions such as DataRecordNotFoundException only for displaying a more detailed error message in the UI, besides the error message in UI the handling would be the same for all exceptions. Is that reason enough tho? I'm sure the user would be thankful to know as detailed as possible what went wrong, but at the end of the day it wouldn't really change how he interacts with my app, my concern is just about being as transparent as possible what went wrong 🤷‍♂️ . What do you guys think?
120 replies
CC#
Created by Florian Voß on 10/2/2023 in #help
❔ need help fixing Bug in WPF app
I got code to place windows on the screen where the MainWindow is located by grabbing it's handler. I then set window's top to the handler's top location and same for left. On most devices works as expected, window spawns on top left edge of mainwindow's screen. However on two clients out of roughly 20, there is a bug. On those clients, when opening on a certain screen of the three screens they're using, window spawns in nirvana, far more in the top RIGHT than visible. on the other two screen's they're using the window spawns in the center of screen on top rather than left top. On the other 18 clients, whatever screen you use it will always work as expected and spawn on top left edge of mainwindow's screen Those two clients facing the bugg have the exact same environment as the 18 clients where it works as expected, that is same Hardwares, same OS and same display settings. I'm lost how to debug this. there is no error in the event viewer. when you move the window using windows key + arrows it moves into appearance
public void PositionOnMainWindowScreen(Window window)
{
var mainwindowSource = PresentationSource.FromVisual(this) as HwndSource;
var mainWindowScreen = Screen.FromHandle(mainwindowSource.Handle);
window.WindowStartupLocation = WindowStartupLocation.Manual;
window.Left = mainWindowScreen.WorkingArea.Left;
window.Top = mainWindowScreen.WorkingArea.Top;
}
public void PositionOnMainWindowScreen(Window window)
{
var mainwindowSource = PresentationSource.FromVisual(this) as HwndSource;
var mainWindowScreen = Screen.FromHandle(mainwindowSource.Handle);
window.WindowStartupLocation = WindowStartupLocation.Manual;
window.Left = mainWindowScreen.WorkingArea.Left;
window.Top = mainWindowScreen.WorkingArea.Top;
}
16 replies
CC#
Created by Florian Voß on 9/27/2023 in #help
❔ UI freezing in Maui
when I populate a collection with items, let's say 300 of them, the UI gets frozen for around two seconds. The rendering blocks the UI in the way that it cannot be interacted with such as scrolling or minimizing/maximizing. How can I solve this? I thought about implementing pagination but here is the thing - First, 300 doesn't seem like many records, does it really require pagination? And also pagination wouldn't really solve the issue of blocked UI, it would just reduce the two seconds down to an amount that is less annoying. What should I do?
27 replies
CC#
Created by Florian Voß on 9/19/2023 in #help
❔ ✅ JWT signatures not working
string jwtMessage = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0";
string publicKey = @"-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo
4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u
+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh
kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ
0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg
cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc
mwIDAQAB
-----END PUBLIC KEY-----";
string privateKey = @"PLACEHOLDER, private key same pem format";
string jwtSignature;
using (var rsa = RSA.Create())
{
rsa.ImportFromPem(privateKey);
jwtSignature = Base64UrlEncoder.Encode(rsa.SignData(Encoding.UTF8.GetBytes(jwtMessage), HashAlgorithmName.SHA256, RSASignaturePadding.Pss));
}
using (var rsa = RSA.Create())
{
rsa.ImportFromPem(publicKey);
var signatureBytes = Encoding.UTF8.GetBytes(Base64UrlEncoder.Decode(jwtSignature));
var data = Encoding.UTF8.GetBytes(jwtMessage);

// Verify the created signature using jwtMessage fails, output is false
Console.WriteLine(rsa.VerifyData(data, signatureBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pss));
}
string jwtMessage = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0";
string publicKey = @"-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo
4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u
+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh
kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ
0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg
cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc
mwIDAQAB
-----END PUBLIC KEY-----";
string privateKey = @"PLACEHOLDER, private key same pem format";
string jwtSignature;
using (var rsa = RSA.Create())
{
rsa.ImportFromPem(privateKey);
jwtSignature = Base64UrlEncoder.Encode(rsa.SignData(Encoding.UTF8.GetBytes(jwtMessage), HashAlgorithmName.SHA256, RSASignaturePadding.Pss));
}
using (var rsa = RSA.Create())
{
rsa.ImportFromPem(publicKey);
var signatureBytes = Encoding.UTF8.GetBytes(Base64UrlEncoder.Decode(jwtSignature));
var data = Encoding.UTF8.GetBytes(jwtMessage);

// Verify the created signature using jwtMessage fails, output is false
Console.WriteLine(rsa.VerifyData(data, signatureBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pss));
}
I took the public and private key as well as the jwtMessage from sample data on jwt.io. I created my own siganture for the token using the private key from their, and tried to verify the signature using the matching public key I took from there. What am I doing wrong?
6 replies
CC#
Created by Florian Voß on 8/28/2023 in #help
❔ Need help urgently with production app not behaving as expected
this issue is with a WPF app: App.ShutdownMode is equal to ShutdownMode.OnLastWindowClose. When I run and debug in Visual Studio it works as expected, upon closing the last window the app shuts down nicely. When I close a window while still having another window open, app keeps running as it should. in the published app this does not work as expected, closing any window other than the MainWindow causes the app to shutdown even when the MainWindow is still open, the opposite, closing mainwindow while having another window open does not shut down the app Anyone have a clue whats going on here?
6 replies
CC#
Created by Florian Voß on 8/25/2023 in #help
❔ Need help with publishing
We use click-once deployment. I am using Visual Studio Publish Wizard. I incremented the version number and pressed "Publish". Visual studio says "Publish Succeeded" Now upon restarting the application on a client, it successfully installs the new version from our NAS which means publishing has worked. However the new donloaded version of the app doesn't start, even tho it worked for me before I have published. All I have as information is this Error Summary here:
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of \\Nas02\Software\AgentUI\AgentUI.application resulted in exception. Following failure messages were detected:
+ Exception occurred during store operation.
+ The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of \\Nas02\Software\AgentUI\AgentUI.application resulted in exception. Following failure messages were detected:
+ Exception occurred during store operation.
+ The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
As you can see it complains about 1. Exception during store operation 2. file being used by another process about first error I have no idea what this means, regarding second - I have checked which processes are using the file, there are none...
3 replies
CC#
Created by Florian Voß on 8/24/2023 in #help
❔ Dynamic sizing of Grid Rows
I am faced with a UI problem in WPF and looking for some ideas on how to deal with it: I have a grid with 3 rows. a row contains a DataGrid that can be visible or not depending whether it has data. I want to size the rows dynamicly, in respect to how many grid rows have data - that is when there is only one row it shall take full height, when its 3 it should be commonly distributed etc. My initial approach would be to set the height of these rows to * which will use dynamic sizing in respect to available space and then add or remove rows to grid in the code-behind. I'm just concerned whether this is a good idea because I can imagine that adding and removing rows to a grid at runtime costs a lot. I could also always use 3 rows and just change the height of those that are empty to 0 tho. those are the two ideas I have. What do you guys think?
2 replies
CC#
Created by Florian Voß on 8/22/2023 in #help
❔ please help fix NullRefException
public partial class MainPage : ContentPage, INotifyPropertyChanged
{
private List<Contact> _contacts;
public List<Contact> Contacts { get => _contacts; set { _contacts = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Contacts")); } }
public event PropertyChangedEventHandler PropertyChanged;
public MainPage()
{
InitializeComponent();
BindingContext = this;
}
private void Button_Clicked(object sender, EventArgs e)
{
Contacts = new List<Contact>
{
new Contact(){ Age = "24" }
};
}
}
public partial class MainPage : ContentPage, INotifyPropertyChanged
{
private List<Contact> _contacts;
public List<Contact> Contacts { get => _contacts; set { _contacts = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Contacts")); } }
public event PropertyChangedEventHandler PropertyChanged;
public MainPage()
{
InitializeComponent();
BindingContext = this;
}
private void Button_Clicked(object sender, EventArgs e)
{
Contacts = new List<Contact>
{
new Contact(){ Age = "24" }
};
}
}
<VerticalStackLayout>
<Button Text="ClickMe" Clicked="Button_Clicked"/>
<ListView ItemsSource="{Binding Contacts}">
<ListView.ItemTemplate>
<DataTemplate>
<Label TextColor="White" BackgroundColor="Green" Text="{Binding Age}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</VerticalStackLayout>
<VerticalStackLayout>
<Button Text="ClickMe" Clicked="Button_Clicked"/>
<ListView ItemsSource="{Binding Contacts}">
<ListView.ItemTemplate>
<DataTemplate>
<Label TextColor="White" BackgroundColor="Green" Text="{Binding Age}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</VerticalStackLayout>
the setter of Contacts property keeps throwing NullRef and I don't know why. As far as I can see I have implemented the interface exactly how they did in the docs https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/data-binding/binding-mode, but I can't see Contact's Age in my UI.
3 replies
CC#
Created by Florian Voß on 8/22/2023 in #help
❔ DataGrid control in Maui
I am migrating a WPF app to Maui and I have issues translating a WPF <DataGrid> to Maui. There doesn'T seem to be a control that renders a table with columns & rows based on a binded Collection as per this issue https://github.com/dotnet/maui/issues/1259# So now what to do? I could try to build this thing myself with ListView tho but that seems like a horrible approach. Another possibility is to include Telerik UI, they have a DataGrid control for Maui but that adds an additional dependency and even costs money for the license, all that for just a single UI component. I am a little lost on what to do now and its my graduation project so I highly appreciate any help on this
24 replies
CC#
Created by Florian Voß on 8/15/2023 in #help
❔ ✅ how to open tel: link on Maui?
Process.Start(new ProcessStartInfo("tel:12345"));
Process.Start(new ProcessStartInfo("tel:12345"));
Win32Exception: "An error occurred trying to start process 'tel:12345' with working directory 'C:\\WINDOWS\\system32'. The system cannot find the file specified." when I do same thing in wpf app it works
37 replies
CC#
Created by Florian Voß on 8/15/2023 in #help
❔ start Phone call in .Net MAUI
if(PhoneDialer.Default.IsSupported){
PhoneDialer.Default.Open(phonenumber);
}
if(PhoneDialer.Default.IsSupported){
PhoneDialer.Default.Open(phonenumber);
}
I am debugging on windows right now. The debugger enters the if clause but doesnt open the dialer app. No exception getting thrown, what's wrong??
3 replies