|
80 | 80 | <p id="ignoreThis">Ignore this</p> |
81 | 81 | </ContextMenuTrigger> |
82 | 82 |
|
| 83 | +<ContextMenuTrigger MenuId="menu7" MouseButtonTrigger="MouseButtonTrigger.Left"> |
| 84 | + <p id="menu7-test1-trigger">Left-click me (menu7)</p> |
| 85 | +</ContextMenuTrigger> |
83 | 86 |
|
84 | 87 |
|
85 | 88 | <ContextMenu Id="menu1" Template="dark" OnAppearing="OnAppearingMenu1"> |
|
137 | 140 | <Item Id="menu6-item2" OnClick="OnClick"><ItemChild>Item 2</ItemChild></Item> |
138 | 141 | </ContextMenu> |
139 | 142 |
|
| 143 | +<ContextMenu Id="menu7" AutoHide="false"> |
| 144 | + <Item Id="menu7-item1">Item 1</Item> |
| 145 | + <Item Id="menu7-item2">Item 2</Item> |
| 146 | +</ContextMenu> |
| 147 | + |
140 | 148 | <div> |
141 | 149 | <button id="showMenuBtn" @onclick="ShowMenuBtnOnClick">Show menu1 in 300x300 using handler</button> |
142 | 150 | <button id="showNoAutoCloseBtn" @onclick="ShowNoAutoCloseBtnOnClick">Show menu1 in 300x300 using handler</button> |
143 | 151 | <button id="showAndHideMenuBtn" @onclick="ShowAndHideMenuBtnClick">Show menu1 in 300x300 using handler and hide after 2 seconds</button> |
144 | 152 | </div> |
145 | 153 |
|
| 154 | +<div> |
| 155 | + <button id="determineIfMenu7IsShownbtn" @onclick="DetermineIfMenu7IsShown">Determine if menu7 is shown</button> |
| 156 | + <p id="menu7-isShownResult">@IsMenu7Shown</p> |
| 157 | +</div> |
| 158 | + |
146 | 159 | <hr /> |
147 | 160 |
|
148 | 161 | <ContextMenuTrigger MenuId="menu2"> |
|
172 | 185 | </div> |
173 | 186 | </ContextMenuTrigger> |
174 | 187 |
|
175 | | - |
176 | 188 | <NavLink href="/TodoList">Go to Todo List</NavLink> |
177 | 189 | <div id="app_loaded"></div> |
178 | 190 |
|
179 | 191 | @code{ |
180 | 192 | private bool menu1Autoclose = true; |
| 193 | + |
181 | 194 | protected async Task ShowMenuBtnOnClick() |
182 | 195 | { |
183 | 196 | await blazorContextMenuService.ShowMenu("menu1", 300, 300); |
|
201 | 214 |
|
202 | 215 | protected Animation Animation { get; set; } |
203 | 216 |
|
| 217 | + protected string IsMenu7Shown { get; set; } = bool.FalseString; |
| 218 | + |
| 219 | + protected async Task DetermineIfMenu7IsShown() |
| 220 | + { |
| 221 | + var isShown = await blazorContextMenuService.IsMenuShown("menu7"); |
| 222 | + IsMenu7Shown = isShown.ToString(); |
| 223 | + } |
| 224 | + |
204 | 225 | async Task FetchDataClick(ItemClickEventArgs e) |
205 | 226 | { |
206 | 227 | Console.WriteLine("Fetching"); |
|
0 commit comments