');-webkit-mask-repeat:no-repeat;-webkit-mask-position:50% 0;-webkit-mask-size:.5em 1em;-webkit-clip-path:inset(0 0 calc(1em - .5em) 0)padding-box;clip-path:inset(0 0 calc(1em - .5em) 0)padding-box;background-color:currentColor !important;margin-left:.125rem;padding:0 .25em;opacity:.84}code{font-family:fira code,monospace;color:#212121}code{font-size:85%;background-color:#f8f8f8;border-radius:6px;padding:.2em .4em;margin:0}.btn{display:inline-block;background-color:#055deb;color:#fff;font-size:16px;line-height:1.5;font-weight:700;text-align:center;text-decoration:none;padding:14px 24px;border-radius:28px;vertical-align:middle;border:2px solid transparent;will-change:background-color,color}@media screen and (max-width:640px){.btn{padding:14px 16px}}.btn.product-bg{background-color:var(--product-color)}.btn-bordered{background-color:transparent;border-color:#055deb;color:#055deb}.btn-white-bordered{background-color:transparent;border-color:#fff;color:#fff}.icon-button{position:relative;width:48px;height:48px;border-radius:50%}.icon-button .icon{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);font-size:24px;color:#055deb}.arrow-link{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-decoration:none;font-size:16px;font-weight:700;line-height:1.2;margin:0;padding:0}.arrow-link span{color:inherit;border-bottom:1px solid transparent}.arrow-link svg{width:20px;height:20px}.arrow-link.prev span{margin-left:4px;padding-top:2px;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}input,textarea{font-family:pragmatica,Helvetica,Arial,sans-serif;font-size:16px;padding:12px 16px;border-radius:3px;border:1px solid #c6c6c6;margin-bottom:28px}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#8f95a3}input::-moz-placeholder,textarea::-moz-placeholder{color:#8f95a3}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#8f95a3}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#8f95a3}input::-moz-placeholder,textarea::-moz-placeholder{color:#8f95a3}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#8f95a3}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#8f95a3}input~.error-message{visibility:hidden;color:#ff4a4a;font-size:13px;line-height:16px;margin-top:-24px;margin-bottom:8px}@media screen and (max-width:640px){input~.error-message{display:none}}input:not(:focus):not(:placeholder-shown):valid{border-color:#c6c6c6}textarea{overflow:auto;overflow-wrap:break-word;resize:none}select{display:none}form{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;text-align:left}form label{display:block;font-size:14px;color:#212121;font-weight:700;margin-bottom:4px}form .form-actions{margin-top:32px}form .form-actions .submit-holder .btn{width:100%}.loading-screen{display:none}.loading-screen .loading-screen-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(255,255,255,.95);z-index:1001;text-align:center}.loading-screen .sending .text{margin-top:12px;margin-left:10px}.loading-screen .error{display:none;max-width:640px;margin:0 auto}.loading-screen .error .title{font-size:30px;font-weight:300;padding-top:32px;margin-bottom:16px}.loading-screen .error .btn-back .arrow-link{margin-top:40px;margin-left:-24px}.expandable-section .expandable-section-link .link-show-more [class*=text-]{border-bottom:2px solid transparent}.expandable-section .expandable-section-link .link-show-more .text-hide{display:none}.animated-arrow-icon.to-left{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.animated-arrow-icon .arrow-container{-webkit-transform:translateX(-4px);transform:translateX(-4px)}.animated-arrow-icon .arrow-line{stroke-dasharray:13px;stroke-dashoffset:13px}body,html{height:100%;margin:0;padding:0;color:#212121;font-family:pragmatica,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}html{scroll-padding-top:64px}.wrapper{min-height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.main{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.content-holder{position:relative;max-width:1260px;margin-right:auto;margin-left:auto;padding-right:40px;padding-left:40px}@media screen and (max-width:768px){.content-holder{padding-right:32px;padding-left:32px}}@media screen and (max-width:480px){.content-holder{padding-right:20px;padding-left:20px}}.section-content{padding-top:80px;padding-bottom:80px}@media screen and (max-width:768px){.section-content{padding-top:56px;padding-bottom:56px}}.page-content{padding-top:calc(var(--navbar-height) + 40px);padding-bottom:80px}@media screen and (max-width:768px){.page-content{padding-top:calc(var(--navbar-height) + 24px);padding-bottom:56px}}#navbar{position:absolute;width:100%;height:var(--navbar-height);z-index:1000;background-color:var(--navbar-color)}#navbar .content-holder{height:100%}#navbar .nav-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navigation{height:100%}@media screen and (max-width:876px){.navigation{display:none}}.navigation .nav-list{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;list-style:none}#navbar{--navbar-item-bg:rgba(255, 255, 255, .12);--navbar-item-underline:rgba(255, 255, 255, .75)}.nav-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 22px;border-radius:0 0 8px 8px;-webkit-transform:translateZ(0)}@media screen and (max-width:1200px){.nav-item{padding:0 14px}}@media screen and (max-width:1024px){.nav-item{padding:0 10px}}.nav-item:last-child.button{padding:0 0 0 10px}.nav-item:last-child.link{padding:0 0 0 22px}.nav-item.opens-subnav{border-radius:0}.nav-item .nav-link{text-decoration:none;font-size:15px;color:var(--navbar-link-color);font-weight:700;line-height:20px;opacity:.75}@media screen and (min-width:961px){.nav-item .nav-link{font-size:16px}}.nav-item .nav-link span{padding-bottom:1px;border-bottom:1px solid transparent}.nav-item .nav-link.with-caret-icon:after{content:'';display:inline-block;vertical-align:middle;margin:-3px 0 0 6px;border-bottom:2px solid #fff;border-right:2px solid #fff;width:6px;height:6px;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-transform-origin:66% 66%;transform-origin:66% 66%}.nav-item .nav-link.with-caret-icon span{border-style:dotted}.nav-item .nav-link.external-link{display:-webkit-box;display:-ms-flexbox;display:flex}.nav-item .nav-link.external-link span{margin-bottom:-2px}.nav-item .nav-link.dotted-underline span{border-style:dotted}.nav-item .nav-button{padding:10px 20px;line-height:1.2}@media screen and (max-width:1024px){.nav-item .nav-button{padding:8px 12px}}@media screen and (max-width:991px){.nav-item .nav-button{font-size:14px;padding:8px}}@media screen and (min-width:1101px){.nav-item .short-name{display:none}}@media screen and (max-width:1100px){.nav-item .short-name+span{display:none}}.mobile-subnav .subsection-holder .subsection-title,.subnav-topbar .title-holder .title{color:rgba(0,0,0,.38);font-size:20px;font-weight:300}.subnav{visibility:hidden;opacity:0;background-color:#fff;will-change:opacity}@media screen and (max-width:876px){.subnav{width:100%;overflow-x:hidden}}.subnav .desktop-subnav,.subnav .mobile-subnav{display:none;height:100%}@media screen and (min-width:877px){.subnav .desktop-subnav{display:block}}.subnav .desktop-subnav .subsection{display:none}@media screen and (max-width:876px){.subnav .mobile-subnav{display:block}}.subnav .content-holder{overflow:auto}@media screen and (min-width:877px){.subnav .content-holder{padding-top:32px}}.subnav .navigation{display:block;padding-bottom:32px;height:auto}@media screen and (min-width:877px){.subnav .navigation{border-bottom:1px dotted rgba(0,0,0,.16);margin-bottom:32px}}.subnav .navigation .nav-list .nav-item{padding:0 32px 0 0}.subnav .navigation .nav-list .nav-item .nav-link{font-size:16px;font-weight:400;color:#212121;opacity:1}.subnav .navigation .nav-list .nav-item .nav-link.with-caret-icon:after{display:none}.mobile-subnav .subnav-body{display:-webkit-box;display:-ms-flexbox;display:flex;width:200%;height:calc(var(--app-window-height) - var(--navbar-height) - 72px);will-change:transform}.mobile-subnav .nav-holder,.mobile-subnav .subsection-holder{width:100%}.mobile-subnav .subsection-holder{will-change:transform}.mobile-subnav .subsection-holder .subsection{display:none}.mobile-subnav .subsection-holder .subsection-title{margin:16px 0 12px}.mobile-subnav .navigation{padding:0 0 12px}.mobile-subnav .navigation .nav-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mobile-subnav .navigation .nav-list .nav-item{padding:0;margin:0 -16px}.mobile-subnav .navigation .nav-list .nav-item .nav-link{width:100%;padding:20px 16px;border-radius:3px}.mobile-subnav .navigation .nav-list .nav-item .nav-button{color:#055deb;border:1px solid;margin:8px 16px;padding:12px 32px;min-width:220px}@media screen and (max-width:480px){.mobile-subnav .navigation .nav-list .nav-item .nav-button{width:100%}}.subnav-topbar{position:relative;padding:12px 0}@media screen and (min-width:877px){.subnav-topbar{display:none}}.subnav-topbar .subnav-underline{position:absolute;left:0;bottom:0;width:100%;height:1px;background:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.12)),color-stop(50%,rgba(0,0,0,.12)),color-stop(0,transparent),to(transparent));background:linear-gradient(90deg,rgba(0,0,0,.12),rgba(0,0,0,.12) 50%,transparent 0,transparent);background-size:6px 1px}.subnav-topbar .topbar-holder{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.subnav-topbar .title-holder{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.subnav-topbar .title-holder .arrow-link{display:none}.subnav-topbar .close-btn{margin-right:-6px}.subnav-topbar .close-btn .icon-button .icon{color:rgba(0,0,0,.26)}@media screen and (max-width:876px){.subnav-content{margin-top:16px}}.subnav-content .section .heading{color:#055deb;font-size:24px;font-weight:300;padding-top:0;margin-bottom:24px}@media screen and (min-width:877px){.subnav-content .section .heading{display:none}}@media screen and (max-width:876px){.subnav-content .section .heading{color:#8f95a3;font-size:20px}}.subnav-content ul{list-style:none}.subnav-content .categories{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-column-gap:32px;-moz-column-gap:32px;column-gap:32px}@media screen and (max-width:876px){.subnav-content .categories{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}.subnav-content .category{padding:0 40px 40px 0}@media screen and (max-width:876px){.subnav-content .category{padding-bottom:24px;padding-right:0}}.subnav-content .category .subheading{color:#8f95a3;font-size:14px;margin-bottom:10px}@media screen and (min-width:877px){.subnav-content .category .subheading{font-size:16px}}.subnav-content .category-products{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.product-item:not(:last-child){margin-bottom:6px}@media screen and (min-width:877px){.product-item{margin-left:-16px}}@media screen and (max-width:876px){.product-item{margin-right:0}}.product-item .product-link{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:16px;border-radius:8px;min-width:100px;text-decoration:none}@media screen and (min-width:877px){.product-item .product-link{max-width:400px}}@media screen and (max-width:876px){.product-item .product-link{padding:14px 16px;margin-left:-16px;margin-right:-16px}}.product-item .product-link.with-description{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.product-item .product-link .external-link{display:-webkit-box;display:-ms-flexbox;display:flex}.product-item .product-link svg{-ms-flex-negative:0;flex-shrink:0;margin-right:12px;width:44px;height:44px}@media screen and (max-width:876px){.product-item .product-link svg{margin:0 16px 0 0;width:32px;height:32px}}.product-item .product-link span{font-size:15px;color:#212121}@media screen and (max-width:876px){.product-item .product-link span{font-size:16px}}.product-item .product-link .description{font-size:14px;color:#6a707f;margin-top:4px}#navbar{--logo-underline:white;--product-main-logo:white;--menu-icon:white;--menu-icon-border:rgba(255, 255, 255, .54)}.logo .logo-nav-link .icon-menu{font-size:24px;color:var(--menu-icon)}.logo .logo-nav-link .icon-menu:before{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px}.logo{height:100%;margin-right:auto}.logo .logo-nav-link{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-decoration:none;height:100%;padding:0 20px;margin-left:-20px;will-change:width}@media screen and (max-width:876px){.logo .logo-nav-link{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%}}.logo .logo-nav-link .main-logo{height:30px}@media screen and (max-width:876px){.logo .logo-nav-link .main-logo{height:24px}}@media screen and (min-width:877px){.logo .logo-nav-link .icon-menu{display:none}}.logo .logo-nav-link.product-logo{position:relative}.logo .logo-nav-link.product-logo .main-logo{position:absolute;top:0;width:100px;-webkit-transform-origin:left;transform-origin:left;-webkit-transform:scale(.45)translateY(0)translateZ(0);transform:scale(.45)translateY(0)translateZ(0);will-change:transform}.logo .logo-nav-link.product-logo .main-logo svg path{fill:var(--product-main-logo)}.logo .logo-nav-link.product-logo .icon-menu{border:1px solid var(--menu-icon-border);margin:-1px}.logo .logo-nav-link.product-logo .product-sign{-ms-flex-negative:0;flex-shrink:0;display:inline-block;width:40px;height:40px;vertical-align:middle}.logo .logo-nav-link.product-logo .product-sign svg path{fill:#fff}.logo .logo-nav-link.product-logo .product-name{text-decoration:none;font-size:30px;font-weight:300;color:var(--navbar-logo-text-color);line-height:1;margin:3px 0 0 8px;vertical-align:middle;border-bottom:1px dotted transparent}@media screen and (max-width:1080px){.logo .logo-nav-link.product-logo .product-name{font-size:26px;margin-top:1px}}@media screen and (max-width:960px){.logo .logo-nav-link.product-logo .product-name{font-size:20px}}@media screen and (max-width:876px){.logo .logo-nav-link.product-logo .icon-menu,.logo .logo-nav-link.product-logo .main-logo{display:none}}@media screen and (max-width:480px){.logo .logo-nav-link.product-logo{width:126px}.logo .logo-nav-link.product-logo .icon-menu{display:block;border-color:transparent}.logo .logo-nav-link.product-logo .product-sign{margin-left:6px}.logo .logo-nav-link.product-logo .product-name{display:none}}#navbar{--lang-select-arrow-color:rgba(255, 255, 255, .64);--lang-select-bg-color:rgba(255, 255, 255, .12)}.language-select-holder{position:relative;margin:0 -10px 0 20px}@media screen and (max-width:1024px){.language-select-holder{margin-left:8px}}@media screen and (max-width:768px){.language-select-holder{margin-left:auto}}@media screen and (min-width:877px){.mobile-arrow-nav-item{display:none}}.mobile-arrow-nav-item .nav-link{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:22px 0;color:#212121;border-top:1px dotted rgba(0,0,0,.16)}.mobile-arrow-nav-item .icon{font-size:24px;color:rgba(0,0,0,.26);margin-right:6px}:root{--snackbar-bottom-position:20px}.common-tab-content{display:none;opacity:0}.modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;z-index:1003;-webkit-animation:animateTop .2s;animation:animateTop .2s}.modal .modal-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background-color:#fff;border-radius:10px;-webkit-box-shadow:0 2px 16px 0 rgba(0,0,0,.38);box-shadow:0 2px 16px rgba(0,0,0,.38);max-width:600px;max-height:calc(100vh - 2 * 40px);margin:40px auto;color:#212121}@media screen and (max-width:640px){.modal .modal-content{margin:40px 16px}}.modal .modal-header{-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:16px 32px}.modal .modal-header .modal-title{color:#212121;font-size:24px;font-weight:300;line-height:1.2;padding-top:8px;margin-bottom:0}.modal .modal-body{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;padding:0 32px 16px}.modal .modal-footer{-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:16px 32px}@-webkit-keyframes animateTop{0%{top:-300px;opacity:0}100%{top:0;opacity:1}}@keyframes animateTop{0%{top:-300px;opacity:0}100%{top:0;opacity:1}}.code-editor{position:relative;display:block;font-family:fira code,monospace;font-size:13px;background-color:#fff;font-weight:400;border-radius:4px;padding:0 0 0 30px;margin-bottom:20px;-webkit-box-shadow:0 1px 3px 0 rgba(200,221,255,.6),0 4px 25px #c8ddff;box-shadow:0 1px 3px rgba(200,221,255,.6),0 4px 25px #c8ddff}@media screen and (max-width:640px){.code-editor{padding-left:15px}}@media screen and (max-width:576px){.code-editor{white-space:normal;word-wrap:break-word}}.code-editor .hide{display:none !important}.code-editor .scroll{overflow:auto;max-height:750px;padding-left:5px;margin-left:-5px}@media screen and (max-width:640px){.code-editor .scroll{padding-left:10px;margin-left:-10px}}.code-editor:before{position:absolute;content:'';top:0;left:0;background:#f0f0f0;border-right:1px solid #d0d0d0;width:30px;height:100%;border-radius:4px 0 0 4px;z-index:2}@media screen and (max-width:640px){.code-editor:before{width:15px}}.code-editor .comments{color:gray;font-weight:500;font-style:italic;white-space:nowrap}.code-editor .keyword{color:navy;font-weight:500}.code-editor .link,.code-editor .string{color:#397f00;font-weight:500;background-color:transparent}.code-editor.visual-studio .comments{color:green;font-weight:400;font-style:normal}.code-editor.visual-studio .keyword{color:#00f}.code-editor.visual-studio .link{color:#00f;font-weight:400}.code-editor.visual-studio .name{color:#2b91af}.code-editor.xml-code .comments{color:green;font-weight:400;font-style:normal}.code-editor.xml-code .tag{color:#3b00fa}.code-editor.xml-code .tagname{color:#860907}.code-editor.xml-code .attribute{color:#ff1e1a}.code-editor.xml-code .string{color:#3b00f9}.ul-tree{position:relative;padding-left:0;margin:0}@media screen and (max-width:576px){.ul-tree{background-color:#fff}}.ul-tree ul{position:relative;margin:0;padding-left:0}.ul-tree ul:last-child{margin-bottom:0}.ul-tree .fourth-level,.ul-tree .second-level,.ul-tree .third-level{padding-left:12px}.ul-tree .bordered-level{border-left:1px solid #e6e6e6}.ul-tree .active>.shortening{display:none}.ul-tree .active>.filling{background-color:transparent}.ul-tree .active>.left-brace,.ul-tree .active>.right-brace{margin:0}.ul-tree .filling{background-color:#ecfaeb}.ul-tree .no-shift{padding:0}.ul-tree .no-shift li{padding:0}.ul-tree .right-brace{margin-left:-8px;padding-right:1px}.ul-tree li{position:relative;list-style:none outside none;margin:0;padding-left:14px;line-height:20px;white-space:nowrap}@media screen and (max-width:640px){.ul-tree li{line-height:18px}}.ul-tree>li{padding-left:8px}@media screen and (max-width:640px){.ul-tree>li{line-height:18px}}.ul-tree .empty-line{line-height:19px}@media screen and (max-width:640px){.ul-tree .empty-line{line-height:18px}}.ul-tree.ul-tree-drop .drop{position:absolute;width:11px;height:11px;top:6px;left:-5px;background:url(/images/icons/code-collapse-controls.png)no-repeat;z-index:2}.ul-tree.ul-tree-drop .second-level .drop{top:5px;left:-25px}.ul-tree.ul-tree-drop .second-level .drop-bottom{left:-25px;bottom:6px}.ul-tree.ul-tree-drop .third-level .drop{left:-52px}.ul-tree.ul-tree-drop .third-level .drop-bottom{left:-52px}.ul-tree.ul-tree-drop .drop-bottom{position:absolute;display:inline-block;width:11px;height:11px;bottom:5px;left:-5px;background:url(/images/icons/code-collapse-controls.png)-22px 0 no-repeat;z-index:2}.ul-tree.ul-tree-drop .active>.drop{background-position:-11px 0}#redirect-suggestion .modal-content{max-width:500px}#redirect-suggestion .modal-footer{gap:16px;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}@media screen and (max-width:480px){#redirect-suggestion .modal-footer{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-bottom:16px}}#redirect-suggestion .modal-footer .btn{padding:8px 20px}#redirect-suggestion .modal-footer .btn-no{min-width:96px}.additional-field{height:0;font-size:0;line-height:0;padding:0;margin:0;border:none;overflow:hidden}.thank-you-section{display:none}.thank-you-section .thank-you-holder{max-width:460px;margin:0 auto;text-align:center}.thank-you-section .icon{font-size:64px;color:#055deb}.thank-you-section .title{font-size:30px;font-weight:700;padding-top:8px;margin-bottom:8px}.code-tabs{--code-tabs-indicator-line-color:var(--product-color);margin:20px 0 32px}.code-tabs .tabs{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.code-tabs .tabs .tab{position:relative;display:inline-block;padding:14px 16px;font-family:pragmatica,Helvetica,Arial,sans-serif;color:#8f95a3;font-weight:700;font-size:12px;line-height:1}.code-tabs .code-tab-content p{padding-top:0 !important;margin-bottom:8px}.code-tab-content{display:none}.code-tab-content p:first-child{padding-top:0 !important}:root{--hero-overlay-color:black}.dotnetbrowser .hero.product{background-image:url(/images/product-visuals/dotnetbrowser.webp)}@media screen and (max-width:768px){.dotnetbrowser .hero.product{background-image:url(/images/product-visuals/dotnetbrowser-mobile.webp)}}.hero.product{position:relative;background-position:50% 60%;background-repeat:no-repeat;background-size:cover}.hero.product:before{content:'';position:absolute;background:-webkit-gradient(linear,left top,right top,color-stop(20%,var(--hero-overlay-color)),to(transparent))no-repeat;background:linear-gradient(to right,var(--hero-overlay-color) 20%,transparent 100%)no-repeat;background-size:cover;opacity:.8;width:100%;height:100%;top:0;left:0;right:0;bottom:0}@media screen and (max-width:768px){.hero.product:before{background:#000;opacity:.65}}.hero.product .page-content{color:#fff;padding-bottom:48px}.hero.product .page-content .title{font-size:30px;color:#fff;font-weight:700;margin-bottom:24px;line-height:1.3}@media screen and (max-width:960px){.hero.product .page-content .title br{content:""}.hero.product .page-content .title br:after{content:" "}}@media screen and (max-width:480px){.hero.product .page-content .title{font-size:24px}}.hero.product .page-content .mobile-product-name{font-size:40px;font-weight:300;color:#fff}@media screen and (min-width:481px){.hero.product .page-content .mobile-product-name{display:none}}.hero.product .page-content .requirements{text-shadow:0 1px 2px rgba(0,0,0,.6);margin-bottom:40px}.hero.product .page-content .requirements.no-bottom-margin{margin-bottom:0}@media screen and (max-width:480px){.hero.product .page-content .hero-btn{width:100%}}.hero.product .page-content .release-info{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:40px;list-style:none;text-shadow:0 1px 2px rgba(0,0,0,.6);letter-spacing:.2px}@media screen and (max-width:640px){.hero.product .page-content .release-info{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}.hero.product .page-content .release-info li{margin-right:24px;margin-top:8px}.hero.product .page-content .release-info .icon{display:inline-block;font-size:20px;vertical-align:middle;margin-top:-3px}.hero.product .page-content a:not(.btn){color:#fff;text-decoration:none;border-bottom:1px solid rgba(255,255,255,.5)}.why-product .row{display:grid;grid-template-columns:repeat(3,1fr);gap:32px 80px}@media screen and (max-width:768px){.why-product .row{grid-template-columns:1fr}}.why-product .row .why-item{position:relative}.why-product .row .why-item .icon{font-size:32px;color:#055deb}@media screen and (max-width:768px){.why-product .row .why-item .icon{position:absolute}}.why-product .row .why-item .info-block{padding-top:10px}@media screen and (max-width:768px){.why-product .row .why-item .info-block{padding-top:6px;padding-left:56px}}.why-product .row .why-item .title{font-size:18px;padding-top:0;margin-bottom:8px}@media screen and (min-width:1025px){.jxbrowser .features.bento-layout .feature-list .feature-card:first-child{grid-area:a}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(2){grid-area:b}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(3){grid-area:c}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(4){grid-area:d}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(5){grid-area:e}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(6){grid-area:f}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(7){grid-area:g}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(8){grid-area:h}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(9){grid-area:i}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(10){grid-area:j}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(11){grid-area:k}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(12){grid-area:l}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(13){grid-area:m}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(14){grid-area:n}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(15){grid-area:o}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(16){grid-area:p}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(17){grid-area:q}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(18){grid-area:r}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(19){grid-area:s}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(20){grid-area:t}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(21){grid-area:u}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(22){grid-area:v}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(23){grid-area:w}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(24){grid-area:x}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(25){grid-area:y}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(26){grid-area:z}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(27){grid-area:aa}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(28){grid-area:bb}.jxbrowser .features.bento-layout .feature-list .feature-card:nth-child(29){grid-area:cc}}@media screen and (min-width:1025px){.dotnetbrowser .features.bento-layout .feature-list .feature-card:first-child{grid-area:a}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(2){grid-area:b}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(3){grid-area:c}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(4){grid-area:d}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(5){grid-area:e}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(6){grid-area:f}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(7){grid-area:g}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(8){grid-area:h}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(9){grid-area:i}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(10){grid-area:j}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(11){grid-area:k}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(12){grid-area:l}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(13){grid-area:m}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(14){grid-area:n}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(15){grid-area:o}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(16){grid-area:p}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(17){grid-area:q}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(18){grid-area:r}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(19){grid-area:s}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(20){grid-area:t}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(21){grid-area:u}.dotnetbrowser .features.bento-layout .feature-list .feature-card:nth-child(22){grid-area:v}}.features .feature-list .feature-backdrop{position:fixed;background-color:#000;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);top:0;right:0;bottom:0;left:0;opacity:0;z-index:1002}.getting-help .support-plans .body .btn{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:100%}@media screen and (max-width:768px){.getting-help .support-plans .body .btn{font-size:14px;padding:12px 10px}}.pricing .price-options .option-actions .btn{width:100%}.support-pricing .action .btn{width:100%}.simple-integration .common-tab-content .content-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:32px}@media screen and (max-width:860px){.simple-integration .common-tab-content .content-row{display:block;max-width:620px;margin:0 auto}.simple-integration .common-tab-content .content-row .col{margin-bottom:32px}}.simple-integration .common-tab-content .guide-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:40px 0 24px}.simple-integration .code-container .title{font-size:24px;font-weight:300;padding:0;margin-bottom:16px}.simple-integration .code-container .subtitle{font-size:14px;color:#6a707f;margin:-16px 0 16px}.simple-integration .code-column>.code-container{margin-bottom:40px}.simple-integration .code-tabs .tabs{margin-bottom:20px}.simple-integration .code-tabs .tabs .tab{border:1px solid rgba(var(--product-color-rgb),.7);color:var(--product-color);padding:6px 16px;font-weight:400}.simple-integration .code-tabs .tabs .tab:first-child{border-radius:3px 0 0 3px}.simple-integration .code-tabs .tabs .tab:not(:first-child){border-left:none}.simple-integration .code-tabs .tabs .tab:last-child{border-radius:0 3px 3px 0}.simple-integration .code-tabs .code-container .subtitle{margin-top:-8px}.simple-integration .demo{position:relative;padding-top:56px}@media screen and (min-width:1201px){.simple-integration .demo{margin:0 32px}}.simple-integration .demo .demo-image{position:relative;border-radius:4px;overflow:hidden;margin:16px auto 0;-webkit-box-shadow:0 1px 3px 0 rgba(200,221,255,.6),0 4px 25px #c8ddff;box-shadow:0 1px 3px rgba(200,221,255,.6),0 4px 25px #c8ddff}.simple-integration .demo .demo-image:before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1}.simple-integration .demo .demo-image .app-window{position:relative;display:block;width:100%;height:auto}.dotnetbrowser .simple-integration .demo{padding-top:52px}@media screen and (max-width:860px){.dotnetbrowser .simple-integration .demo{padding-top:0}}.modal.contact-modal .modal-body{padding-bottom:32px}.modal form .form-actions{margin-top:0}.modal .thank-you-section .section-content{padding-top:20px}
使用 Shadcn UI 构建 C# 桌面应用
发布:

Anna Dolbina

多年来,.NET 开发者一直使用 WinForms 和 WPF 等工具包构建桌面应用。这些框架虽然能够完成任务并提供原生控件,但要让界面看起来现代化却需要大量的额外工作。默认组件显得过时,而添加流畅的动画或简洁的现代风格也并非易事。
相比之下,Web 技术发展迅速。借助 React 等框架和庞大的库生态系统,开发者可以快速构建响应迅速、界面美观的应用。因此,许多流行应用(如 Slack、Notion、Microsoft Teams)即使在桌面版本中也采用了基于 Web 的用户界面。
在本文中,我们将介绍一种架构,它既能保持 Web 的灵活性和高效性,又能提供原生桌面体验。
为什么要在桌面上使用 Web UI?
在桌面应用中使用 Web UI 具有超越外观的明显优势。现代 Web 技术可以轻松构建出简洁、响应迅速且在不同平台上表现一致的界面。
其真正的优势在于庞大的生态系统。有大量现成的组件可供使用,并且 Web 开发者众多,因此您可以减少重复造轮子的时间,将更多精力投入到实际应用的开发中。
跨平台支持也是一大亮点。借助 Avalonia 或 DotNetBrowser 等框架,您可以在 Windows、macOS 和 Linux 上运行同一套代码,而无需维护多个版本。
此外,这种架构还具有灵活性。同一个前端可以同时用于 Web 和桌面,从而简化开发流程、实现工作复用,并避免重复劳动。

带有 Web UI 的桌面应用截图
完整源代码可在 GitHub 上获取。
挑战
乍一看,将 Web UI 嵌入到 .NET 桌面应用中似乎很简单,但有几个挑战需要解决:
- 安全的加载资源。 应用不应依赖本地或远程服务器加载其 UI,并且捆绑的资源不得暴露。
- JavaScript 与 .NET 之间的通信。 Web UI 需要一种安全且结构化的方式来调用后端逻辑并接收结果。
让我们看看 Avalonia 和 DotNetBrowser 如何帮助解决这些挑战。
应用窗口与 Web 视图
我们使用 Avalonia 创建应用窗口并处理原生集成。在窗口内部,嵌入 DotNetBrowser 的 BrowserView
—— 一个基于 Chromium 的 Web 视图组件。
XAML 窗口定义:
<Window ...>
<app:BrowserView x:Name="BrowserView" />
</Window>
后台初始化代码:
private async void Window_Opened(object? sender, EventArgs e)
{
Browser = ServiceProvider.GetService<IEngineService>()?.CreateBrowser();
BrowserView.InitializeFrom(Browser);
await Browser.Navigation.LoadUrl("dnb://internal.host/");
}
在后台代码中,我们初始化 Chromium 引擎,并加载仅供内部使用、外部无法访问的 UI。
加载页面
在 Web 开发中,通过本地开发服务器运行应用并自动重新加载更改是一种常见做法——这是大多数前端开发者习以为常的工作流程。在我们的设置中,我们保留了同样的方法:Web 应用在本地运行并启用热重载,因此你可以立即看到更新,而无需每次重新构建整个桌面应用。
在生产环境中,我们不想依赖 Web 服务器。为什么呢?首先,任何能够访问服务器 URL 的人都可以窥探其资源,包括本应保密的逻辑。其次,这增加了额外的组件,使部署和维护变得更加复杂。
相反,我们将前端资源嵌入到应用包中,并使其仅在应用内部可用。
DotNetBrowser 为此提供了自定义协议处理器(Custom Scheme Handler)。它允许我们拦截特定协议(如 my-app://
)的请求,并以任意数据进行响应,而非从远程服务器获取。在示例中,当浏览器请求 index.html
或其他文件时,我们会从应用资源中读取并返回:
public class ResourceRequestHandler : ISchemeHandler
{
public InterceptRequestResponse Handle(InterceptRequestParameters parameters)
{
string url = parameters.UrlRequest.Url;
// 定位并读取嵌入资源(如 index.html、JS、CSS)。
...
}
}
...
EngineOptions engineOptions = new EngineOptions.Builder
{
Schemes =
{
{ Scheme.Create("my-app"), new ResourceRequestHandler() }
}
}.Build();
IEngine engine = EngineFactory.Create(engineOptions);
通过这种设置,我们拦截所有对 my-app://
URL 方案的请求,并允许常规的 HTTP 请求通过。结果是,我们得到了一个安全、自包含的软件包,它可以离线运行并隐藏资源不被直接访问。
JavaScript 与 .NET 之间的通信
Web UI 非常适合展示,但大多数实际工作仍在其他地方进行。例如,读取或写入文件、保存设置或与操作系统交互等操作只能由 .NET 后端完成。然而,前端需要触发这些操作并获取结果。因此,我们需要一种 JavaScript 与 .NET 之间进行通信的方式。
JavaScript 与 .NET 之间的直接调用
对于小型项目,一个简单的桥接机制就足够了。大多数 WebView 组件都允许 JavaScript 与 .NET 直接通信。有的通过传递 JSON 消息实现,有的(如 DotNetBrowser)则允许在 JavaScript 中直接访问 .NET 对象。反之亦然。下面是一个简单的示例。
首先,我们在 C# 中定义一个类。然后,我们在 TypeScript 中镜像它,保持相同的接口。接着,我们配置 DotNetBrowser 将 .NET 实例注入到匹配类型的 JavaScript 对象中。
让我们考虑以下简单的 C# 类:
public class PrefsService {
public void SetBrightness(int percents) {
...
}
}
然后,让我们在 TypeScript 中镜像它:
// 匹配的类。
declare class PrefsService {
SetBrightness(percents: number): void;
}
// 托管对象的全局变量。
declare const prefService: PrefsService;
...
prefService.SetBrightness(95);
最后,当页面加载时,我们将 .NET 对象注入到
已声明的 JavaScript 变量中:
browser.InjectJsHandler = new Handler<InjectJsParameters>(p =>
{
dynamic window = p.Frame.ExecuteJavaScript("window").Result;
if (window != null)
{
window.prefService = new PrefsService();
}
});
这是一种简单而有效的方法——至少在开始时是这样。问题在于,它的扩展性不佳。您必须手动保持 C# 和 TypeScript 定义同步,并且随着 API 的增长和发展,不可避免的不匹配问题将成为持续的 bug 源头。
JavaScript 与 .NET 之间的 RPC 通信
与其保持两个独立的定义同步,我们可以定义一次数据,并让工具生成匹配的 C# 和 TypeScript 代码。
我们使用 Protobuf 和 gRPC 来处理前端和后端之间的通信。Protobuf 以语言中立的方式定义共享的数据结构和服务,并为 C# 和 TypeScript 生成类型安全的代码。
结果:请求和响应在构建时即可校验,并且您无需任何额外设置即可获得完整的类型提示和自动补全功能。

JavaScript 和 .NET 之间的通信。
以下是等效的 Protobuf 定义:
service PrefsService {
rpc SetBrightness(Brightness) returns (google.protobuf.Empty);
}
message Brightness {
int32 percents = 1;
}
以及从 Protobuf 定义自动生成的 .NET 实现:
public override Task<Empty> SetBrightness(Brightness brightness, ServerCallContext context)
{
int percents = brightness.percents;
...
return Task.FromResult(new Empty());
}
这次,我们不需要注入对象。但我们需要将 gRPC 主机传递给前端,以便它可以连接:
browser.InjectJsHandler = new Handler<InjectJsParameters>(p =>
{
dynamic window = p.Frame.ExecuteJavaScript("window").Result;
if (window != null)
{
window.rpcAddress = "http://localost:5051";
}
});
现在,Web 前端可以使用自动生成的代码向 .NET 后端发送请求:
import {createGrpcWebTransport} from "@connectrpc/connect-web";
import {createClient} from "@connectrpc/connect";
import {PreferencesService} from "@/gen/prefs_pb.ts";
const transport = createGrpcWebTransport({
baseUrl: `http://localhost:50051`,
});
const prefsClient = createClient(PrefsService, transport);
...
prefsClient.SetBrightness(...);
结论
通过 Web UI 构建桌面应用,可以大幅提升开发效率与灵活性。您可以使用现代 Web 工具,利用庞大的生态系统,打造符合当下审美标准的用户界面。
在本文中,我们结合了 Web 和桌面技术——使用 DotNetBrowser 托管基于 React 的用户界面,将前端捆绑到应用中,并建立了 .NET 和 JavaScript 之间的双向通信。
在此过程中,我们解决了一些常见的痛点:嵌入 Web 视图、无需本地服务器加载静态文件,以及使前端和后端顺畅通信。

发送中。。。
您的个人 DotNetBrowser 试用密钥和快速入门指南将在几分钟内发送至您的电子邮箱。