DataForm Silverlight: "حفظ" و "تحرير" لا تظهر
-
28-09-2019 - |
سؤال
أحاول إنشاء نموذج بيانات في Silverlight 4. ربما أفعل شيئًا خاطئًا.
الفصل:
public class ExpenseInfoTest
{
public int MyProperty { get; set; }
public int Foo { get; set; }
public int Bar { get; set; }
}
XAML:
<local:ExpenseInfoTest x:Key="newExpense"/>
<df:DataForm Height="218"
HorizontalAlignment="Left"
Margin="13,368,0,0"
Name="expenseDataForm"
VerticalAlignment="Top"
Width="590"
CurrentItem="{StaticResource newExpense}" />
ما هو معروض:
أريد زر "حفظ". كيف يمكنني أن أظهر؟ هل هناك شيء خاطئ في XAML أو فئة البيانات؟
المحلول
في XAML الخاص بك ، أضف
CommandButtonsVisibility="All"
في الخاص بك DataForm
إعلان.
إذا أردت ذلك ، يمكنك ربط CommandButtonsVisibility
لنقول صندوق التحرير والسرد
<ComboBox SelectedItem="{Binding CommandButtonsVisibility, ElementName=expenseDataForm, Mode=TwoWay}" SelectedIndex="0" >
وتمكن من التحكم في أزرار الأوامر المتاحة بناءً على اختيار CB.
نصائح أخرى
هذا السطر من الكود مفيد:
expenseDataForm.CommandButtonsVisibility = DataFormCommandButtonsVisibility.All;
لا تنتمي إلى StackOverflow