mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
[PowerRename] Handle many items w/o crashing and OOM (#26761)
* [PowerRename] Disable AnimatedIcon (check mark) for CheckBox to prevent crashes * [PowerRename] Implement lightweight ExplorerItemsSource/VM
This commit is contained in:
25
src/modules/powerrename/PowerRenameUILib/Utils.h
Normal file
25
src/modules/powerrename/PowerRenameUILib/Utils.h
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
// This macro defines a dependency property for a WinRT class.
|
||||
// Use this in your class' header file after declaring it in the idl.
|
||||
// Remember to register your dependency property in the respective cpp file.
|
||||
#define DEPENDENCY_PROPERTY(type, name) \
|
||||
public: \
|
||||
static winrt::Microsoft::UI::Xaml::DependencyProperty name##Property() \
|
||||
{ \
|
||||
return _##name##Property; \
|
||||
} \
|
||||
type name() const \
|
||||
{ \
|
||||
return winrt::unbox_value<type>(GetValue(_##name##Property)); \
|
||||
} \
|
||||
void name(const type& value) \
|
||||
{ \
|
||||
SetValue(_##name##Property, winrt::box_value(value)); \
|
||||
} \
|
||||
\
|
||||
private: \
|
||||
static winrt::Microsoft::UI::Xaml::DependencyProperty _##name##Property;
|
||||
Reference in New Issue
Block a user