Тёмный

Creating .NET MAUI UIs in C# Markup 

dotnet
Подписаться 290 тыс.
Просмотров 21 тыс.
50% 1

Have you ever wanted to create your UI in .NET MAUI using C# instead of XAML? You can, using the .NET MAUI Community Toolkit C# Markup Extensions! Learn how to use the official open-source .NET MAUI C# Markup Extensions library to streamline your UI building process.
00:00 - Intro, Shaun, & Brandon
02:30 - What is C# markup and why use it?
05:45 - C# vs XAML
12:05 - C# markup overview
17:30 - C# markup demo side-by-side
24:00 - Wrap-up
Links:
Markup on GitHub: github.com/CommunityToolkit/M...
Toolkit on GitHub: github.com/communitytoolkit/m...
Toolkit on Docs: docs.microsoft.com/en-us/dotn...
#dotnetmaui #dotnet #communitytoolkit #csharpmarkup #codedui

Наука

Опубликовано:

 

28 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 73   
@SKRUBL0RD
@SKRUBL0RD Год назад
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
@CarlSargunar
@CarlSargunar 2 года назад
This is awesome - great work Sean, James and Brandon
@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. 11 месяцев назад
​@@obinnaokafor6252 screw Comet. What kind of .net tool can't be used in Visual Studio
@lalawuwuwu
@lalawuwuwu 2 года назад
You can do some amazingly complex multi-bindings very easily 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
@ODSD_EXCITEMENT
@ODSD_EXCITEMENT Год назад
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.
@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?
@caiohamamura9832
@caiohamamura9832 Год назад
How do you set up Hot Reloading for C# maekup pages?
@user-vi3qe4td2p
@user-vi3qe4td2p 2 года назад
Can we use 3rd-party xamarin component in MAUI? Migrate xamarin project to MAUI?
@sourgreenapple69
@sourgreenapple69 2 года назад
Love it!
@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 года назад
🙌
@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 Год назад
Fluent API really shines when you need to set attached properies such as row and column numbers
@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.
@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!
@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.
@nirNP
@nirNP Год назад
Hi does hot reload work with c# markup
@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. 11 месяцев назад
Isn't this still mvvm and comet mvu
@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
@martinweihrauch2379
@martinweihrauch2379 Год назад
Why did MS ever invent XAML and did not use plain HTML5?
@ODSD_EXCITEMENT
@ODSD_EXCITEMENT Год назад
So no visual designer for Maui. Very interesting
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
@ziaulhasanhamim3931
@ziaulhasanhamim3931 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
@Dazza_Doo
@Dazza_Doo Год назад
More Gold - Cha-Ching
@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.
@dinhtiendat2611
@dinhtiendat2611 Год назад
I see quite a lot of similarities with swiftUI in ios programming
@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#!
@redstrike91dn
@redstrike91dn Год назад
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.
@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.
@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 ☄️
@luggiiiluggiii7179
@luggiiiluggiii7179 9 месяцев назад
"it's so much easier" hahahaha, only a button, maybe. But Build a Page with two grids and stackpanles xD
@sipepguru
@sipepguru 2 года назад
my brain ..... just struggles with this... what about separation of concerns?
@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.
@axa.axa.
@axa.axa. 3 месяца назад
great now put some examples in documents so people can actually use this.
@luislema3863
@luislema3863 Год назад
C# is late to the party, other frameworks (Flutter, Flet) already do that. But good to see dotnet joining us at last 🙂.
@JohnSmith-dd2nd
@JohnSmith-dd2nd Год назад
YOU NEED TO MAKE
@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.
@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...
@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
.NET Community Toolkit
24:15
Просмотров 12 тыс.
Recycled Car Tyres Get a Second Life! ♻️
00:58
Просмотров 2,8 млн
это самое вкусное блюдо
00:12
Просмотров 2,1 млн
Is There Hope For .NET MAUI?
7:10
Просмотров 25 тыс.
Это спасёт камеру iPhone
0:32
Просмотров 69 тыс.
iOS 18 vs Samsung, Xiaomi,Tecno, Android
0:54
Просмотров 92 тыс.