Skip to content

Instantly share code, notes, and snippets.

public async Task<DependencyObject> GetElementAsync(IElementReference elementReference, Visual viewToSearchIn)
{
string elementReferenceType = elementReference.Type.Description.ToLower();
if (elementReferenceType.Equals("viewcommand"))
{
return GetViewCommandButton(viewToSearchIn, elementReference);
}
else
{
matchedElements = new List<MatchedElement>();
public IEnumerable<DependencyObject> ScanElementsOnMatch(IElementReference elementReference, DependencyObject viewToSearchIn)
{
string elementReferenceType = elementReference.Type.Description.ToLower();
int childrenCount = 0;
Application.Current.Dispatcher.Invoke(() => { childrenCount = VisualTreeHelper.GetChildrenCount(viewToSearchIn); });
for (var i = 0; i < childrenCount; i++)
{
DependencyObject child = null;
Application.Current.Dispatcher.Invoke(() => { child = VisualTreeHelper.GetChild(viewToSearchIn, i); });
foreach (DependencyObject meuk in ScanElementsOnMatch(elementReference, child))
public static IEnumerable<T> SelectRecursive<T>(DependencyObject involvedView, Func<T, IEnumerable<T>> selector)
{
int childrenCount = 0;
Application.Current.Dispatcher.Invoke(() => { childrenCount = VisualTreeHelper.GetChildrenCount(involvedView); });
for (var i = 0; i < childrenCount; i++)
{
foreach (T child in selector(involvedView).SelectRecursive(selector))
{
yield return child;
<cs:CollectionView x:Class="ChipSoft.Ezis.AutomatedTesting.Views.ScriptsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cs="http://chipsoft.com/core/presentation"
Title="{Binding Title}"
CurrentCollection="{Binding CurrentCollection}"
CurrentObject="{Binding CurrentObject}"
SelectedCollection="{Binding SelectedCollection}"
IsMultiSelect="{Binding IsMultiSelect}"
cs:ViewLayout.Id="ID" cs:ViewLayout.SubId="SUBID"
public ObservableField<Integer> total = new ObservableField<>();
"Hey girl did you just went through a chemo, cause you are shining!"
@Entity(tableName = "rack", indices = { @Index("id"), @Index("storage_id") },
foreignKeys = {
@ForeignKey(
entity = Storage.class,
parentColumns = {"id"},
childColumns = {"storage_id"},
onDelete = ForeignKey.CASCADE,
onUpdate = ForeignKey.CASCADE
)}
)
/*
Created by Martijn Bakker with help from 'Learn Web Development'
*/
// HTML class //
class DOMElements {
constructor() {
this.cvs = document.getElementById("canvas_snake_game");
this.menu = document.getElementById("menu");
this.setName = document.getElementById("set_name");
// returns allRacks with correct storage_id
public LiveData<List<UIStorage>> getStorageUnits()
{
getExecutor().execute(() ->
{
Transformations.map(getDao().getStorageUnits(), newData -> createStorageUIList(newData));
});
return ???
}
storageRepository.getStorageUnits(executor).observe(owner, storageUnits ->
{
executor.execute(() ->
{
for (UIStorage uiStorage : storageUnits)
{
storageRepository.setUIStorageElements(uiStorage, imgProcessor);
}
storageListAdapterObsv.set(new StorageListAdapter(storageUnits, mainViewCmdHandlerCallBack));
});