Skip to content

Commit bb7ab35

Browse files
committed
Make updates
1 parent 31a72b9 commit bb7ab35

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Pages/SampleBasePage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e)
5757
{
5858
var page = (Samples.Batching)SampleFrame.Content;
5959
page.StopAllEvents();
60-
} else if(SampleFrame.SourcePageType == typeof(Samples.DXResourceBindingORT))
60+
}
61+
else if(SampleFrame.SourcePageType == typeof(Samples.DXResourceBindingORT))
6162
{
6263
var page = (Samples.DXResourceBindingORT)SampleFrame.Content;
6364
page.StopAllEvents();

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Samples/DXResourceBindingORT/DXResourceBindingORT.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public DXClassifierResult(int i, string lab)
2727
public sealed partial class DXResourceBindingORT : Page
2828
{
2929
private bool pageExited = false;
30+
3031
public DXResourceBindingORT()
3132
{
3233
this.InitializeComponent();
@@ -78,7 +79,7 @@ private void UpdateClassificationResults(float[] results)
7879
List<int> top_10_imagenet_indices = top_1k_imagenet_indices.Take(10).ToList();
7980

8081
List<DXClassifierResult> dx_classifier_results = new List<DXClassifierResult>();
81-
for (int i = 0; i < 10; i++)
82+
for (int i = 0; i < top_10_imagenet_indices.Count; i++)
8283
{
8384
dx_classifier_results.Add(new DXClassifierResult(i+1,
8485
ClassificationLabels.ImageNet[top_10_imagenet_indices[i]]));

Samples/WinMLSamplesGallery/WinMLSamplesGalleryNative/Win32Application.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ int Win32Application::Run(D3D12Quad* pSample, int nCmdShow)
5858
nullptr, // We aren't using menus.
5959
hInstance,
6060
pSample);
61-
if (!m_hwnd)
62-
{
63-
MessageBox(NULL, L"Error creating window",
64-
L"Error", MB_OK | MB_ICONERROR);
65-
return false;
66-
}
61+
if (!m_hwnd) { MessageBox(NULL, L"Error creating window", L"Error", MB_OK | MB_ICONERROR); return false; }
6762

6863
// Initialize the sample and show the window
6964
pSample->OnInit();
@@ -76,7 +71,8 @@ int Win32Application::Run(D3D12Quad* pSample, int nCmdShow)
7671
{
7772
// Destroy the sample and window if the close_window
7873
// variable is set to true
79-
if (close_window) {
74+
if (close_window)
75+
{
8076
pSample->OnDestroy();
8177
PostMessage(m_hwnd, WM_CLOSE, 0, 0);
8278
break;
@@ -149,7 +145,7 @@ void Win32Application::CloseWindow()
149145
std::wstring Win32Application::GetAssetPath(LPCWSTR assetName)
150146
{
151147
WCHAR modulePath[512];
152-
UINT modulePathSize = _countof(modulePath);
148+
UINT modulePathSize = std::size(modulePath);
153149
GetModuleFileName(nullptr, modulePath, modulePathSize);
154150

155151
const wchar_t* gallery = L"WinMLSamplesGallery";

0 commit comments

Comments
 (0)