OpenGLView 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
OpenGLView is obsolete as of .NET 7. To enable this view you will need to call builder.UseMauiCompatibility
but it is currently untested and unsupported.
顯示 OpenGL 內容的 View。
public ref class OpenGLView sealed : Microsoft::Maui::Controls::View, Microsoft::Maui::Controls::IElementConfiguration<Microsoft::Maui::Controls::OpenGLView ^>, Microsoft::Maui::Controls::IOpenGlViewController
[System.Obsolete("OpenGLView is obsolete as of .NET 7. To enable this view you will need to call `builder.UseMauiCompatibility` but it is currently untested and unsupported.")]
public sealed class OpenGLView : Microsoft.Maui.Controls.View, Microsoft.Maui.Controls.IElementConfiguration<Microsoft.Maui.Controls.OpenGLView>, Microsoft.Maui.Controls.IOpenGlViewController
[<System.Obsolete("OpenGLView is obsolete as of .NET 7. To enable this view you will need to call `builder.UseMauiCompatibility` but it is currently untested and unsupported.")>]
type OpenGLView = class
inherit View
interface IOpenGlViewController
interface IViewController
interface IVisualElementController
interface IElementController
interface IElementConfiguration<OpenGLView>
Public NotInheritable Class OpenGLView
Inherits View
Implements IElementConfiguration(Of OpenGLView), IOpenGlViewController
- 繼承
- 屬性
- 實作
備註
OpenGLView最簡單的方式是使用共用專案來進行程式設計,在此情況下,Opentk 簡介的參考非常簡單。 下列範例示範具有轉譯循環的簡單OpenGL應用程式:
using Microsoft.Maui.Controls;
using OpenTK.Graphics.ES30;
namespace opengl
{
public class OpenGLPage : ContentPage
{
float red, green, blue;
public OpenGLPage ()
{
Title = "OpenGL";
var view = new OpenGLView { HasRenderLoop = true };
var toggle = new Switch { IsToggled = true };
var button = new Button { Text = "Display" };
view.HeightRequest = 300;
view.WidthRequest = 300;
view.OnDisplay = r => {
GL.ClearColor (red, green, blue, 1.0f);
GL.Clear ((ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit));
red += 0.01f;
if (red >= 1.0f)
red -= 1.0f;
green += 0.02f;
if (green >= 1.0f)
green -= 1.0f;
blue += 0.03f;
if (blue >= 1.0f)
blue -= 1.0f;
};
toggle.Toggled += (s, a) => {
view.HasRenderLoop = toggle.IsToggled;
};
button.Clicked += (s, a) => view.Display ();
var stack = new StackLayout {
Padding = new Size (20, 20),
Children = {view, toggle, button}
};
Content = stack;
}
}
}
建構函式
OpenGLView() |
已淘汰.
使用預設值建立新的 OpenGLView 物件。 |
欄位
HasRenderLoopProperty |
已淘汰.
識別 HasRenderLoop 可繫結屬性。 |
propertyMapper |
已淘汰.
表示檢視的內部 PropertyMapper。 (繼承來源 View) |
屬性
AnchorX |
已淘汰.
取得或設定相對於專案界限之任何轉換作業之中心點的 X 元件。 這是可繫結屬性。 (繼承來源 VisualElement) |
AnchorY |
已淘汰.
取得或設定相對於專案界限的任何轉換作業之中心點的 Y 元件。 這是可繫結屬性。 (繼承來源 VisualElement) |
AutomationId |
已淘汰.
取得或設定值,允許自動化架構尋找此項目並與之互動。 (繼承來源 Element) |
Background |
已淘汰.
取得或設定 Brush 用來填滿專案背景的 。 這是可繫結屬性。 (繼承來源 VisualElement) |
BackgroundColor |
已淘汰.
取得或設定 Color ,其會填滿專案的背景。 這是可繫結屬性。 (繼承來源 VisualElement) |
Batched |
已淘汰.
取得值,這個值表示已針對這個項目進行批次變更。 (繼承來源 VisualElement) |
Behaviors |
已淘汰.
取得與這個專案相關聯的物件清單 Behavior 。 這是唯讀的可繫結屬性。 (繼承來源 VisualElement) |
BindingContext |
已淘汰.
取得或設定 對象,這個物件包含屬於這個 BindableObject之系結屬性的目標屬性。 這是可繫結屬性。 (繼承來源 BindableObject) |
Bounds |
已淘汰.
取得與裝置無關單位的專案界限。 (繼承來源 VisualElement) |
class |
已淘汰.
顯示 OpenGL 內容的 View。 (繼承來源 NavigableElement) |
ClassId |
已淘汰.
取得或設定值,用來識別語意類似項目的集合。 (繼承來源 Element) |
Clip |
已淘汰.
指定專案的裁剪區域。 這是可繫結屬性。 (繼承來源 VisualElement) |
DesiredSize |
已淘汰.
取得這個項目在版面配置處理序的測量傳遞期間所計算的大小。 (繼承來源 VisualElement) |
DisableLayout |
已淘汰.
取得值,這個值表示已停用這個專案的配置。 (繼承來源 VisualElement) |
Dispatcher |
已淘汰.
取得建立這個可系結物件時可用的發送器,否則會嘗試尋找最接近的可用發送器, (可能是視窗/應用程式的) 。 (繼承來源 BindableObject) |
EffectControlProvider |
已淘汰.
供 .NET MAUI 內部使用。 (繼承來源 Element) |
Effects |
已淘汰.
取得或設定將在運行時間套用至項目的樣式和屬性。 (繼承來源 Element) |
FlowDirection |
已淘汰.
取得或設定配置流程方向。 這是可繫結屬性。 (繼承來源 VisualElement) |
Frame |
已淘汰.
取得或設定這個項目位於畫面上的框架。 (繼承來源 VisualElement) |
GestureController |
已淘汰.
顯示 OpenGL 內容的 View。 (繼承來源 View) |
GestureRecognizers |
已淘汰.
與此檢視建立關聯的筆勢辨識器集合。 (繼承來源 View) |
Handler |
已淘汰.
取得或設定 IViewHandler 與這個項目相關聯的 。 (繼承來源 VisualElement) |
HasRenderLoop |
已淘汰.
此 OpenGLView 是否有自訂轉譯迴圈。 |
Height |
已淘汰.
取得此項目的目前呈現高度。 這是唯讀的可繫結屬性。 (繼承來源 VisualElement) |
HeightRequest |
已淘汰.
取得或設定此項目所需的高度覆寫項。 這是可繫結屬性。 (繼承來源 VisualElement) |
HorizontalOptions |
已淘汰.
取得或設定 , LayoutOptions 定義如何在版面配置週期中配置專案。 這是可繫結屬性。 (繼承來源 View) |
Id |
已淘汰.
取得值,這個值可用來在應用程式執行期間唯一識別專案。 (繼承來源 Element) |
InputTransparent |
已淘汰.
取得或設定值,指出這個專案是否會在用戶互動期間響應點擊測試。 這是可繫結屬性。 (繼承來源 VisualElement) |
IsEnabled |
已淘汰.
取得或設定值,這個值指出使用者介面中是否已啟用此項目。 這是可繫結屬性。 (繼承來源 VisualElement) |
IsEnabledCore |
已淘汰.
這個值代表累計 IsEnabled 值。 如果值將會變更,覆寫此屬性的所有類型也需要叫用 RefreshIsEnabledProperty () 方法。 (繼承來源 VisualElement) |
IsFocused |
已淘汰.
取得值,這個值指出此項目目前是否為焦點。 這是可繫結屬性。 (繼承來源 VisualElement) |
IsInPlatformLayout |
已淘汰.
取得或設定值,這個值表示這個專案目前正在平臺版面配置週期中。 (繼承來源 VisualElement) |
IsLoaded |
已淘汰.
指出專案是否連接到主要物件樹狀結構。 (繼承來源 VisualElement) |
IsPlatformEnabled |
已淘汰.
取得或設定值,這個值表示是否啟用這個項目的平臺對等專案。 (繼承來源 VisualElement) |
IsPlatformStateConsistent |
已淘汰.
取得或設定值,這個值表示這個專案目前與平臺對等項目狀態一致。 (繼承來源 VisualElement) |
IsVisible |
已淘汰.
取得或設定值,這個值會決定此元素是否會在螢幕上顯示,並佔用版面配置的空間。 這是可繫結屬性。 (繼承來源 VisualElement) |
LogicalChildren |
已淘汰.
供 Microsoft.Maui.Controls 平台內部使用。 (繼承來源 Element) |
Margin |
已淘汰.
取得或設定檢視的邊界。 (繼承來源 View) |
MaximumHeightRequest |
已淘汰.
取得或設定專案在版面配置期間要求的最大高度。 這是可繫結屬性。 (繼承來源 VisualElement) |
MaximumWidthRequest |
已淘汰.
取得或設定專案在版面配置期間要求的最大寬度。 這是可繫結屬性。 (繼承來源 VisualElement) |
MinimumHeightRequest |
已淘汰.
取得或設定專案在版面配置期間要求的最低高度。 這是可繫結屬性。 (繼承來源 VisualElement) |
MinimumWidthRequest |
已淘汰.
取得或設定專案在版面配置期間要求的最低寬度。 這是可繫結屬性。 (繼承來源 VisualElement) |
Navigation |
已淘汰.
顯示 OpenGL 內容的 View。 (繼承來源 NavigableElement) |
NavigationProxy |
已淘汰.
顯示 OpenGL 內容的 View。 (繼承來源 NavigableElement) |
OnDisplay |
已淘汰.
覆寫以建立自訂轉譯迴圈。 |
Opacity |
已淘汰.
取得或設定套用至項目 (呈現時) 的不透明度值。 這個值的範圍是 0 到 1;超出此範圍的值將會設定為最接近的有效值。 這是可繫結屬性。 (繼承來源 VisualElement) |
Parent |
已淘汰.
取得或設定這個專案的父 Element 代。 (繼承來源 Element) |
RealParent |
已淘汰.
供 .NET MAUI 內部使用。 (繼承來源 Element) |
Resources |
已淘汰.
取得或設定本機資源字典。 (繼承來源 VisualElement) |
Rotation |
已淘汰.
取得或設定呈現元素時繞著 Z 軸 (仿射旋轉) 的旋轉 (度)。 這是可繫結屬性。 (繼承來源 VisualElement) |
RotationX |
已淘汰.
取得或設定呈現元素時繞著 X 軸 (透視旋轉) 的旋轉 (度)。 這是可繫結屬性。 (繼承來源 VisualElement) |
RotationY |
已淘汰.
取得或設定呈現元素時繞著 Y 軸 (透視旋轉) 的旋轉 (度)。 這是可繫結屬性。 (繼承來源 VisualElement) |
Scale |
已淘汰.
取得或設定套用至項目的縮放比例。 這是可繫結屬性。 (繼承來源 VisualElement) |
ScaleX |
已淘汰.
取得或設定要套用至 X 方向的小數位數值。 這是可繫結屬性。 (繼承來源 VisualElement) |
ScaleY |
已淘汰.
取得或設定要套用至 Y 方向的小數位數值。 這是可繫結屬性。 (繼承來源 VisualElement) |
Shadow |
已淘汰.
取得或設定 專案所轉換的陰影效果。 這是可繫結屬性。 (繼承來源 VisualElement) |
Style |
已淘汰.
顯示 OpenGL 內容的 View。 (繼承來源 NavigableElement) |
StyleClass |
已淘汰.
顯示 OpenGL 內容的 View。 (繼承來源 NavigableElement) |
StyleId |
已淘汰.
取得或設定使用者定義值來唯一識別項目。 (繼承來源 Element) |
TranslationX |
已淘汰.
取得或設定項目的 X 轉譯差異。 這是可繫結屬性。 (繼承來源 VisualElement) |
TranslationY |
已淘汰.
取得或設定項目的 Y 轉譯差異。 這是可繫結屬性。 (繼承來源 VisualElement) |
Triggers |
已淘汰.
取得與這個專案相關聯的物件清單 TriggerBase 。 這是唯讀的可繫結屬性。 (繼承來源 VisualElement) |
VerticalOptions |
已淘汰.
取得或設定 , LayoutOptions 定義如何在版面配置週期中配置專案。 這是可繫結屬性。 (繼承來源 View) |
Visual |
已淘汰.
取得或設定實 IVisual 作,這個實作會覆寫專案的視覺外觀。 這是可繫結屬性。 (繼承來源 VisualElement) |
Width |
已淘汰.
取得這個專案目前的寬度。 這是唯讀的可繫結屬性。 (繼承來源 VisualElement) |
WidthRequest |
已淘汰.
取得或設定此項目所需的寬度覆寫項。 這是可繫結屬性。 (繼承來源 VisualElement) |
Window |
已淘汰.
Window取得與項目相關聯的 。 這是唯讀的可繫結屬性。 (繼承來源 VisualElement) |
X |
已淘汰.
取得此項目的目前 X 位置。 這是唯讀的可繫結屬性。 (繼承來源 VisualElement) |
Y |
已淘汰.
取得此項目的目前 Y 位置。 這是唯讀的可繫結屬性。 (繼承來源 VisualElement) |
ZIndex |
已淘汰.
取得或設定版面配置中專案的前至后 z 索引。 這是可繫結屬性。 (繼承來源 VisualElement) |
方法
事件
BatchCommitted |
已淘汰.
呼叫 來認可屬性變更批次時 BatchCommit()發生。 (繼承來源 VisualElement) |
BindingContextChanged |
已淘汰.
發生於 BindingContext 屬性的值變更時。 (繼承來源 BindableObject) |
ChildAdded |
已淘汰.
每當子專案加入至 項目時引發。 (繼承來源 Element) |
ChildRemoved |
已淘汰.
每當從專案中移除子項目時引發。 (繼承來源 Element) |
ChildrenReordered |
已淘汰.
發生於這個專案的子系順序變更時。 (繼承來源 VisualElement) |
DescendantAdded |
已淘汰.
每當子專案加入至專案的子樹時引發。 (繼承來源 Element) |
DescendantRemoved |
已淘汰.
每當從專案子樹中移除子項目時引發。 (繼承來源 Element) |
DisplayRequested |
已淘汰.
顯示 OpenGL 內容的 View。 |
FocusChangeRequested |
已淘汰.
顯示 OpenGL 內容的 View。 (繼承來源 VisualElement) |
Focused |
已淘汰.
發生於此項目焦點時。 (繼承來源 VisualElement) |
HandlerChanged |
已淘汰.
每當項目的處理程式變更時引發。 (繼承來源 Element) |
HandlerChanging |
已淘汰.
每當項目的處理程序開始變更時引發。 (繼承來源 Element) |
Loaded |
已淘汰.
發生於已建構專案並加入至物件樹狀結構時。 (繼承來源 VisualElement) |
MeasureInvalidated |
已淘汰.
發生於專案的目前量值已失效時。 (繼承來源 VisualElement) |
ParentChanged |
已淘汰.
每當專案的父代變更時引發。 (繼承來源 Element) |
ParentChanging |
已淘汰.
每當項目的 開始變更時引發。 (繼承來源 Element) |
PropertyChanged |
已淘汰.
當屬性值變更時發生。 (繼承來源 BindableObject) |
PropertyChanging |
已淘汰.
當屬性值變更中時發生。 (繼承來源 BindableObject) |
SizeChanged |
已淘汰.
發生於專案的大小變更時。 (繼承來源 VisualElement) |
Unfocused |
已淘汰.
發生於這個專案未對焦時。 (繼承來源 VisualElement) |
Unloaded |
已淘汰.
當專案不再連接到主要物件樹狀結構時發生。 (繼承來源 VisualElement) |
明確介面實作
擴充方法
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應