Creating .NET MAUI UIs in C# Markup

  Рет қаралды 22,194

dotnet

dotnet

Күн бұрын

Пікірлер: 74
@CarlSargunar
@CarlSargunar 2 жыл бұрын
This is awesome - great work Sean, James and Brandon
@SKRUBL0RD
@SKRUBL0RD 2 жыл бұрын
regardless of which method used, there should be a visual GUI system like visual basic etc. to work with the UI side instead of just c# or xaml
@kynesyn
@kynesyn 2 жыл бұрын
Awesome! Psyched that we can use C# to write UI. So much better than having to try and encode / decode XAML and as mentioned avoids all the crazy out of sync nonsense. Having an additional layer like XAML never made much sense to me. We can do so much more directly in code. No need to reinterpret XML constructs. Just pure C# Hooray! Thanks Brandon, Shaun and the community for making a toolkit to simplify the code and make it slick! Love this!
@brandonminnick
@brandonminnick 2 жыл бұрын
Thanks!!! There's still a bunch more we can add to CommunityToolkit.Maui.Markup and we'd love your help to contribute more features! github.com/communitytoolkit/maui.markup
@obinnaokafor6252
@obinnaokafor6252 2 жыл бұрын
Nice. James, could you invite James Clancey to talk about C# MVU UI -Comet?
@damaomiX
@damaomiX 2 жыл бұрын
What's the difference between C# markup and comet? Is comet similar to C# markup, but use MVU?
@obinnaokafor6252
@obinnaokafor6252 2 жыл бұрын
@@damaomiX Yes, they both use C#. But Comet is more immutable and uses MVU app model, while C# markup uses mvvm app model. Comet has powerful model binding etc.
@axa.axa.
@axa.axa. Жыл бұрын
​@@obinnaokafor6252 screw Comet. What kind of .net tool can't be used in Visual Studio
@degbayley
@degbayley 2 жыл бұрын
What benefit does a Fluent API provide over Object and Collection initializers. For example, in the NumericValidationBehaviour you show: Content = new Entry { Keyboard = Keyboard.Numeric, }.Behaviours( new NumericValidationBehaviour { // ... }); I must be missing something, because the existing method looks better to me: Content = new Entry { Keyboard = Keyboard.Numeric, Behaviours = { new NumericValidationBehaviour { // ... } } };
@lalawuwuwu
@lalawuwuwu 2 жыл бұрын
Fluent API really shines when you need to set attached properies such as row and column numbers
@caiohamamura9832
@caiohamamura9832 2 жыл бұрын
How do you set up Hot Reloading for C# maekup pages?
@martinweihrauch2379
@martinweihrauch2379 2 жыл бұрын
Why did MS ever invent XAML and did not use plain HTML5?
@ODSD_EXCITEMENT
@ODSD_EXCITEMENT 2 жыл бұрын
for hi performance commercial desktop apps I will always default to C# compiled Bindings; I know it requires more code, but I want to get every optimization at the UI layer because a lot of more expensive work is done in the app.
@惊寂
@惊寂 2 жыл бұрын
Can we use 3rd-party xamarin component in MAUI? Migrate xamarin project to MAUI?
@fieryscorpion
@fieryscorpion 2 жыл бұрын
What's the difference between 'CommunityToolkit.Maui.Markup' and 'Comet' coding style wise? They're both trying to bring C# markup, right? If that's the case, shouldn't those efforts be consolidated?
@axa.axa.
@axa.axa. Жыл бұрын
Isn't this still mvvm and comet mvu
@emreaka3965
@emreaka3965 2 жыл бұрын
I would love to also develop my user interfaces in C# but I am really hesitant to use XAML. I developed a basic user interface with WPF for my IoT project and XAML looks scary to me. The thing that you showed looks cool.
@nirNP
@nirNP 2 жыл бұрын
Hi does hot reload work with c# markup
@S3Kglitches
@S3Kglitches 2 жыл бұрын
thank you guys for what you are doing. I've never got well with XAML and this might help me continue to use plain MAUI and not choosing Blazor because plain MAUI is faster and has more possibliites than Blazor
@Morten746
@Morten746 2 жыл бұрын
Looks awesome! I like XAML, but part of the reason might be because the alternative of writing the UI in C# has been a painful experience and didn’t provide anywhere near the same overview of hierarchy that XAML does, because you couldn’t properly nest the elements if you wanted to apply styling. The extensions from this library seems to fix that problem though, so I might give it a try!
@S3Kglitches
@S3Kglitches 2 жыл бұрын
But can you use DevExpress controls (and potentially any custom controls) with this C# markup or do C# helpers have to be created first in the community toolkit for every control?
@NicholasStein
@NicholasStein 2 жыл бұрын
I am really happy to see this. I have never gotten my head around XAML. I have been looking at this since Brandon presented on various dotnet/MAUI youtube.
@brandonminnick
@brandonminnick 2 жыл бұрын
🙌
@lalawuwuwu
@lalawuwuwu 2 жыл бұрын
You can do some amazingly complex multi-bindings very easily with C# markup.
@zhh174
@zhh174 2 жыл бұрын
Isn't compiled bindings with XAML faster than bindings in c# because of reflection? As it was mentioned in the docs compiled bindings are resolved at compile time so it doesn't use reflection.
@queenstownswords
@queenstownswords 2 жыл бұрын
Is there a tool to convert from XAML to the C# markup?
@brandonminnick
@brandonminnick 2 жыл бұрын
There is not! But it sounds like a cool idea! Open a New Feature Discussion on the Maui.Markup repo and let's chat more about it! github.com/communitytoolkit/maui.markup/discussions/new
2 жыл бұрын
where can I find training on that?
@brandonminnick
@brandonminnick 2 жыл бұрын
All of the documentation is available online: docs.microsoft.com/dotnet/communitytoolkit/maui/markup/markup?WT.mc_id=dotnet-0000-bramin
@hellbilly56
@hellbilly56 2 жыл бұрын
Can C# and Xaml be used on the same page? It would be interesting to dynamically add content or adjust layout based on some criteria.
@Morten746
@Morten746 2 жыл бұрын
Yeah it can.
@AdamsTaiwan
@AdamsTaiwan 2 жыл бұрын
I already started the switchover to C# in some areas where I found it easier to use compiler switches for different cases.
@sipepguru
@sipepguru 2 жыл бұрын
my brain ..... just struggles with this... what about separation of concerns?
@NathenxBrewer
@NathenxBrewer 2 жыл бұрын
XAML has always seemed convoluted to me. This looks like a cleaner way to write UI. That being said, I wish we could use HTML or Razor markup for our UI so that we can just drop variables in without having to deal with bindings at all.
@marklnz
@marklnz 2 жыл бұрын
Blazor Hybrid doesn't work for you?
@NathenxBrewer
@NathenxBrewer 2 жыл бұрын
@@marklnz Blazor Hybrid is still Blazor components.
@dotnetspark
@dotnetspark 2 жыл бұрын
You could now with Blazor Hybrid
@NathenxBrewer
@NathenxBrewer 2 жыл бұрын
@@dotnetspark Blazor Hybrid just renders Razor components within a WebView window.
@emmanueladebiyi2109
@emmanueladebiyi2109 2 жыл бұрын
Checkout Mobile Blazor Bindings
@pacific_punch1
@pacific_punch1 2 жыл бұрын
Love it!
@marcinzale
@marcinzale 2 жыл бұрын
So, is it good practice to make a UI and app logic both in C#? I've always heard of separating the UI from the application logic...
@bogdanb904
@bogdanb904 2 жыл бұрын
You can have separate classes for UI and logic. Just that the UI is also written in C# .
@J-Kimble
@J-Kimble 2 жыл бұрын
Yeah, this looks like the wrong direction to take the UI in. I've always found UIs written in code without markup hard to reason about. It's also prone to turn into spaghetti. I think a simple markup with bindings like (html) would be a better direction. So maybe a more streamlined lightweight xaml?
@robertmrobo8954
@robertmrobo8954 2 жыл бұрын
What is happening here is they are defining UI in C#, they are not implementing app logic. They are just using one tool to do two separate jobs.
@electrocatalyst
@electrocatalyst 2 жыл бұрын
It's OK to separate two layers but why would you need to develop two different technologies for that and then force people to learn both of them to be able to create even the simplest application?
@robertmrobo8954
@robertmrobo8954 2 жыл бұрын
@@electrocatalyst I'm not sure what you mean when you say two separate techs.
@dukeofqueens4052
@dukeofqueens4052 2 жыл бұрын
I much prefer coding in C# rather than XML and wrote similar extension methods. As a parallel, there has been a gradual move away from config being done in XML over the years and we no longer have to deal with web.config. Would anyone really want to go back? The main challenge with this approach at the moment is the lack of hot reload, unless there's a way to do that I haven't found yet? Comet looks really promising in that area but it's still experimental.
@ODSD_EXCITEMENT
@ODSD_EXCITEMENT 2 жыл бұрын
So no visual designer for Maui. Very interesting
@dinhtiendat2611
@dinhtiendat2611 2 жыл бұрын
I see quite a lot of similarities with swiftUI in ios programming
@sps014
@sps014 2 жыл бұрын
Hoping comet to get some attention now.
@brandonminnick
@brandonminnick 2 жыл бұрын
Same! I can't wait for the C# community to fully embrace MVU 💯
@sps014
@sps014 2 жыл бұрын
@@brandonminnick exactly, already using MAUI Blazor in my company, can't wait to work with ☄️
@redstrike91dn
@redstrike91dn 2 жыл бұрын
Awesome! I rather deal with C# than learn and write XAML with its weird binding syntax :( Please make C# Markup the first-class support of .NET MAUI (also deprecated XAML if possible). It's OK to write JSX in React apps.
@vadimgusev4572
@vadimgusev4572 2 жыл бұрын
It's funny how they replaced ReSharper in the subtitles @6:24 with [inaudible] lmao
@axa.axa.
@axa.axa. 2 жыл бұрын
These captions are autogenerated. He said it like he has a dick in his mouth, As a human being I couldn't even understand what he was trying to say.
@Dazza_Doo
@Dazza_Doo 2 жыл бұрын
More Gold - Cha-Ching
@bogdanb904
@bogdanb904 2 жыл бұрын
This looks a lot like Flutter's syntax.
@oleggavrilov7083
@oleggavrilov7083 2 жыл бұрын
Or swift ui, which is great
@brandonminnick
@brandonminnick 2 жыл бұрын
@@oleggavrilov7083 Yup, that's kinda our goal: bring more fluent UI syntax to C#!
@luggiiiluggiii7179
@luggiiiluggiii7179 Жыл бұрын
"it's so much easier" hahahaha, only a button, maybe. But Build a Page with two grids and stackpanles xD
@istalexnik
@istalexnik Ай бұрын
MAUI C# Markup is way to go, NO more XAML please
@sim756
@sim756 2 жыл бұрын
I would never use C# code to build UI (unless it happens in the background and there's WYSIWYG Visual UI Designer), like what we get for Windows Forms in VS), I just don't get any reason of doing things the hard and dirty way! #XAML is the best thing ever I get to develop UI.
@axa.axa.
@axa.axa. 9 ай бұрын
great now put some examples in documents so people can actually use this.
@JohnSmith-dd2nd
@JohnSmith-dd2nd 2 жыл бұрын
YOU NEED TO MAKE
@bkaankose
@bkaankose 2 жыл бұрын
It's one of those things that Xamarin team decided to support just because they saw Flutter and Swift UI works for their own technology stack, rather than working on faster XAML parser/rendering engine... Showing here the basics won't make anyone to code their UI in C#, specially in big projects like where you need to maintain over 30 pages with an advanced UI. Of course it is always nice to have alternatives, but promoting this and spending team time/effort for something that has no future in Xamarin world is always frustrating unfortunately. I wish team could focus more on making XAML faster and more secure like they did with with XAMLC compilation and compiled bindings few years ago. Admit it. Apps have complex UI has no future with code UI. Make XAML faster, design better controls and make them work properly across platforms. That's what most Xamarin developers expect from MAUI. Comet is there and maintained very nicely. Use Comet if you are a fan. But just don't compare yourself to Flutter just because they handled it well. Both Flutter and XF are different platforms and tech stack, targeting different set of users...
@luislema3863
@luislema3863 Жыл бұрын
C# is late to the party, other frameworks (Flutter, Flet) already do that. But good to see dotnet joining us at last 🙂.
@electrocatalyst
@electrocatalyst 2 жыл бұрын
I understand that these guys from Microsoft have to play it cool and say that both, MAUI and XAML are equally "fun" but let's admit it. Everyone hated XAML. The simplest thing always took 10x more code than it should have and it still didn't work the way you wanted. I've been waying for the WinForms and Qt kind of simplicity in modern .NET GUIs for many years! I hope MAUI will turn out to be this kind of solution.
@aL3891_
@aL3891_ 2 жыл бұрын
Calling it "c# markup" seems weird to me. I think of _xaml_ as "markup", i.e. mixing some code elements into content in a declarative way just like html and razor and c# as imperative code. So its either "markup" i.e xaml _or_ its c#.. "c# markup" just seems like an oxymoron to me :) "Fluent Maui" would have made more sense and better reflect what it does imo..
@frogger3d
@frogger3d 2 жыл бұрын
Markup refers to the process of laying out the UI elements, not the language or syntax used to perform that process.
@aL3891_
@aL3891_ 2 жыл бұрын
Not really, a "markup language" is a language where code fragments is added to regular free text content to add information about layout and such, (the text is "marked up"), that's not the case here, with this you write strict c# possibly with some literals in it, but still c#. That's fine, but calling this "markup" is giving the wrong impression of what it does imo
@frogger3d
@frogger3d 2 жыл бұрын
The library isn't called markup language though is it
@aL3891_
@aL3891_ 2 жыл бұрын
@@frogger3d that's hardly the point :) feel free to call it whatever you like though, but given the target demographic for this library doesn't want to write "markup", they want to write imperative code (witch is what the library _actually_ does), its poorly named.
Build .NET MAUI Apps Faster with the Community Toolkit
21:45
Build .NET MAUI Apps Faster with App Accelerator
22:22
dotnet
Рет қаралды 20 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
The .NET MAUI Community Toolkits - Brandon Minnick - CPH DevFest 2024
58:01
.NET MAUI Community Standup - Matt Goldman & MAUI UI July
1:03:00
.NET Community Toolkit
24:15
Microsoft Visual Studio
Рет қаралды 13 М.
The Return of Procedural Programming - Richard Feldman
52:53
ChariotSolutions
Рет қаралды 50 М.
.NET MAUI Explained: What is it, How does it work, and What about Blazor?
34:28
All things client and mobile app development with .NET MAUI | BRK204
42:55
Microsoft Developer
Рет қаралды 15 М.
Is Functional Programming DEAD Already?
21:07
Continuous Delivery
Рет қаралды 76 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.