A New Way to Randomize in .NET 8We've all used random numbers in C# for various reasons. It has never been difficult to get a random number and use it, we've all probably written something like this: public int GetRandomNumber(int max) { var random = new Random(); return ra...Jan 3, 2024 · 2 min readryanphillips.hashnode.dev
How to use JavaScript in BlazorSome things are simply not possible to do in Blazor without JavaScript. If you need to access things like local storage or make some kinds of interactivity possible we will need to make JS calls. So how do we call JS from C#? To make this happen we w...Aug 15, 2023 · 3 min readryanphillips.hashnode.dev
Using Cascading Values in BlazorThere are several instances where it could be cumbersome to pass the same value down to every child component. Think of something like a theme that every component in the entire app might use. It would become painful to pass the theme again and again...Jul 27, 2023 · 4 min readryanphillips.hashnode.dev
Level Up Your Blazor Components with TemplatesIn my post about creating Blazor components, we went over how to create a simple Button component: <button @onclick="OnClick" @attributes="Attributes"> @Text </button> @code { [Parameter] public string Text { get; set; } = "Click me"; ...Jul 21, 2023 · 3 min readryanphillips.hashnode.dev
Make Your Blazor Components More Flexible With CaptureUnmatchedValuesYou may have noticed when creating your Blazor components that if you try to use an attribute that you don't have a parameter for it fails to build. It can be annoying to have to add attributes for every little thing. That's where CaptureUnmatchedVal...Jul 19, 2023 · 1 min readryanphillips.hashnode.dev