kianyuen
kianyuen
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
No description
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
Yeah, but what about other controls, like Button. it doesn't have anything
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
and I think it didn't work even before I added it. I'm just stumbling on customizing controls so I have to revisit it again.
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
I'm not sure how to check it, I only added Montserrat.
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
Is that font missing from my System?
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
i was messing around so it's a bit messy
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
My App.xaml:
<Application x:Class="MVVM_ScreenFlow.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MVVM_ScreenFlow"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
>
<Application.Resources>
<FontFamily x:Key="Montserrat">pack://application:,,,/Fonts/#Montserrat</FontFamily>
<LinearGradientBrush x:Key="GradientBrush" StartPoint="0,1" EndPoint="1,0">
<GradientStop Color="#3A8EF6" Offset="0" />
<GradientStop Color="#6F3AFA" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedGradientBrush" StartPoint="0,1" EndPoint="1,0">
<GradientStop Color="#3A8EF6" Offset="0"/>
<GradientStop Color="#804CFF" Offset="1"/>
</LinearGradientBrush>
<ResourceDictionary x:Key="menuStyles">
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary />
<ResourceDictionary Source="Styles/ButtonStyles.xaml"/>
<ResourceDictionary Source="Styles/HeadingStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
<Application x:Class="MVVM_ScreenFlow.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MVVM_ScreenFlow"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
>
<Application.Resources>
<FontFamily x:Key="Montserrat">pack://application:,,,/Fonts/#Montserrat</FontFamily>
<LinearGradientBrush x:Key="GradientBrush" StartPoint="0,1" EndPoint="1,0">
<GradientStop Color="#3A8EF6" Offset="0" />
<GradientStop Color="#6F3AFA" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="PressedGradientBrush" StartPoint="0,1" EndPoint="1,0">
<GradientStop Color="#3A8EF6" Offset="0"/>
<GradientStop Color="#804CFF" Offset="1"/>
</LinearGradientBrush>
<ResourceDictionary x:Key="menuStyles">
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary />
<ResourceDictionary Source="Styles/ButtonStyles.xaml"/>
<ResourceDictionary Source="Styles/HeadingStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
yeah that's what I meant by following the guide. the IDE doesn't detect anything abnormal either.
20 replies
CC#
Created by kianyuen on 8/14/2024 in #help
Controls from WPF.UI can't render properly on WPF, .NET Framework 4.8
I mean, it's a NuGet package, the thing is I referenced it all the way from App.xaml to UserControl, the only place there can even be code within my control is this xaml (aside from my screenshot):
<UserControl x:Class="MVVM_ScreenFlow.Views.Modules.BloodPressureView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"

xmlns:local="clr-namespace:MVVM_ScreenFlow.Views.Modules"
mc:Ignorable="d"
d:DesignHeight="700" d:DesignWidth="1280">
<UserControl x:Class="MVVM_ScreenFlow.Views.Modules.BloodPressureView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"

xmlns:local="clr-namespace:MVVM_ScreenFlow.Views.Modules"
mc:Ignorable="d"
d:DesignHeight="700" d:DesignWidth="1280">
20 replies
CC#
Created by kianyuen on 8/6/2024 in #help
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
I keep this snippet as it is because I didn't know what else can I do.
13 replies
CC#
Created by kianyuen on 8/6/2024 in #help
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
yeah. because it's the snippet to read from the port buffer
SerialPort spL = (SerialPort)sender;
byte[] buf = new byte[spL.BytesToRead];
spL.Read(buf, 0, buf.Length);
_receiveBuffer.AddRange(buf);
SerialPort spL = (SerialPort)sender;
byte[] buf = new byte[spL.BytesToRead];
spL.Read(buf, 0, buf.Length);
_receiveBuffer.AddRange(buf);
13 replies
CC#
Created by kianyuen on 8/6/2024 in #help
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
It's queue, so I just delete anything I processed, no?
13 replies
CC#
Created by kianyuen on 8/6/2024 in #help
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
About parsing, my current flow is 1. loop through the buffer scanning for header 2. process/store the data based on the packet definition 3. (haven't implemented validation, but i guess i should put it here) 4. just prune everything til the last processed packet in the buffer. That's it, right?
13 replies
CC#
Created by kianyuen on 8/6/2024 in #help
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
The one I'm currently dealing with is pretty simple, first byte will be used as a header (documented in a PDF file) for each packet (data range from 0 to 7 bytes). This one is pretty overwhelming to me tho, I asked for a demonstration app/source code from the supplier and all they said were "we currently only have the instruction set": - Request data format Command head + command word + length word + data filed + check word Command head: two bytes, Default is 0X55, 0XAA Command word: one byte Length word: two bytes, indicate this command start from length word to check words bytes (not include check word),low-order in front Data filed: this option can be 0 Check word: Byte-by-byte XOR value from the command head to the last byte of the data field - Reply data format Command head + command word + identifier word + length word + data field + check word Command head: two bytes, Default is 0x55,0xAA Command head: one byte Identifier word:one byte, 0x00 means response successfully, others means defeated or error Length word:two bytes,indicate this command start from length word to check words’ bytes (not include check word),low-order in front Data filed: this option can be 0 Check word: Byte-by-byte XOR value from the command head to the last byte of the data field
13 replies
CC#
Created by kianyuen on 8/6/2024 in #help
How to stream bytes from SerialPort (System.IO.Ports) into a chart.
i got some problem with implementing it and had some trouble finding an existing implementation online, but it kinda sorted out for now. i was thinking maybe there was already some way to just pull it packet by packet from the existing buffer of the port but I guess it is inherently this way.
13 replies
CC#
Created by kianyuen on 7/26/2024 in #help
How should Error Status Code returned from a DLLImport function be handled?
Thanks yall.
8 replies
CC#
Created by kianyuen on 7/26/2024 in #help
How should Error Status Code returned from a DLLImport function be handled?
Is there any specific practice regarding using the function when imported it in your app? Like should I make a function to wrap it and throw exception with the error code, if it isnt zero?
8 replies
CC#
Created by kianyuen on 7/18/2024 in #help
ViewModel Command ran when I debugged, but the View is not updated
Process of less boilerplate, better life
18 replies
CC#
Created by kianyuen on 7/18/2024 in #help
ViewModel Command ran when I debugged, but the View is not updated
Too bad WPF isn't modern, I'm a bit in the dark about C# in general too, lol.
18 replies
CC#
Created by Shoey on 7/18/2024 in #help
How can I use a precompiled C/C++ dll in a C# project?
Ah sorry, I didn't take a deep look into the repo
21 replies